0 votes

Hi All. New here, just getting started with Godot. I was wondering what would be the best way to make an object look at and follow another object (a target) in the scene in the same fashion that the interpolated camera does?

The followed object would be a rigid body tumbling down a hill (physics). The follow object would be a parachute behind it to slow it down.

In Armory the 'look at/follow' node/trait can simply be added to anything. In Godot this seems to only be a feature for the camera (although I am sure you can write a script that achieves this?) Thank you!

in Engine by (483 points)

1 Answer

+1 vote

Transform class have a function for interpolation.

func _process(delta: float) -> void:
    global_transform = global_transform.interpolate_with(target.global_transform, delta * speed)
by (148 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 Frequently asked questions and 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.