0 votes

Hello. I am making a 3d game in which you have a side kick that follows you constantly unless told to or is close enough to the player. I have this so far from another Godoter:

func physicsprocess(delta):
var toplayer = translation.directionto(player.translation)
moveandslide(to_player * speed)
velocity.y += delta * gravity

But there's no gravity, and the sidekick isn't facing the player, and I can't figure that one out either. Is there anyway any of ya'll can help me please? Thanks

in Engine by (26 points)

1 Answer

+1 vote

You should check out "Intro to Steering Behaviors in Godot part 1: Follow AI" (2019-10-13) tutorial series:

When you are done watching/coding just download project end source code from github:

Copy and replace code to your project and you should have what you want! :)

Good Luck,

by (74 points)
edited by

Thanks oofman! I'll definitely check it out!

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 [email protected] with your username.