0 votes

Using Tween.isactive() == false in the _physicsprocess function returns false twice before the tween can be started again

example code which shows i increasing by 2 every time 1 tween movement is made
`extends KinematicBody2D

export(float) var movespeed = .2
var initial
position = Vector2()
var inputdirection = Vector2()
var TILE
SIZE = 16
var i = 0

func ready():
initial
position = position
input_direction = Vector2(0,1)

func physicsprocess(delta):
if $Tween.is_active() == false:
print(i)
i = i +1
move()

func move():
$Tween.interpolateproperty(
self, "position",
position, initial
position + (inputdirection * TILESIZE), movespeed,
Tween.TRANS
LINEAR
)
initial_position = position
$Tween.start()`

Godot version 3.3.2.stable.mono.official
in Engine by (21 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.