0 votes

At the moment where i instance thebullet,it doesn't fit in the Position2D.

It shoots but the shoots are not in the same place of the character ,how do i fix it?

I try with global_position.

code shoot:

func shoot():
canshot = false
statemachine.travel("shoot")
var newshoot = balaR.instance()
newshoot.position=$Position2D.position
print(newshoot.position)
get
parent().add_child(newshoot)
$Timer.start(0.5)

in Engine by (12 points)
edited by

1 Answer

0 votes

Check the balaR scene that you're instancing. It's visible contents need to be at the 0,0 position of the local scene. If it's somehow offset in the local scene, it will be offset from the position you specify after instancing it.

by (10,928 points)
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.