0 votes

I have a launching rocket projectile and I need to solve the rocket tracking player's ship
.....thanks for all the help.

in Engine by (450 points)

From time to time the rocket ask player's ship for his position.
This position is the next position for the rocket to go.

1 Answer

+1 vote
Best answer

Like a homing missile?
look_at the target and then use the rocket transform basis as translation vector (* rocket speed) for relative speed.

Something like:

set_translation(get_translation()-get_transform().basis.z*speed*delta) 
#if -z is forward on the model

If you want less precision on the follow (slow rotation), I think you will have to use Quad.slerp instead of look_at.

Check this tutorial to see how to work with Quad on Godot:
http://codetuto.com/2016/01/godot-engine-movement-and-rotation-basics/

by (7,832 points)
selected by

Thanks for answers, I look at it....this is not so easy for someone who does not know how much programming

If you know about 3D design, just go slow, line by line, and make a test scene/project to try stuff until you get yourself oriented on the way things work.

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.