Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ddarkmoto | |
Old Version | Published before Godot 3 was released. |
Hi everyone. I’m trying to move an instanced scene using Kinematicbody2d’s move() method but it doesn’t seem to work. I mean it worked, but not the way I expected. What I wanted for it to happen was for the projectile to continuously move but it doesn’t. A Piece of my code is shown below. Thanks to all who could answer and I’d really appreciate it.
var prjrelease = projectile.instance()
position = get_node("/root/world/character").get_pos() + get_node("/root/world/character/Position2D").get_pos()
prjrelease.set_pos(Vector2(position.x , position.y))
get_parent().add_child(prjrelease)
prjrelease.move_to(Vector2(position.x * delta, 0))
Can you tell me what your script does presently?
not the way I expected
It helps members here to help you.
Anutrix | 2017-04-06 04:38
The code above instantiates a projectile scene and then it’s supposed to move every frame. But it doesn’t.
ddarkmoto | 2017-04-06 13:30