+1 vote

Hi,
How I can make a 3D scene with a monster that follows the player using GDScript?
Thanks in advanced.

Godot version 3.2.3
in Engine by (353 points)

1 Answer

0 votes
Best answer

assuming you have a scene, player and enemy ready...

create a tween and interpolate property on enemy node

var player_pos = playernode.global_position
var my_pos = self.position
$tween.interpolate_property(self, "position", my_pos, player_pos, 0.5, TRANS_LINEAR, EASE_IN_OUT)
$tween.start()
by (363 points)
selected by

I'll try; thanks!!

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.