Godot Version
Godot.v_4.2.2
Question
Does anybody know script for enemy to follow player, i see a lot people use player.position but it seems that isnt’t working if somone knows plese write it to me
Godot.v_4.2.2
Does anybody know script for enemy to follow player, i see a lot people use player.position but it seems that isnt’t working if somone knows plese write it to me
There is not enough information in this question. Is the enemy a Physics body? Is it a 2d game? Is it a top down or side scroller game?
These details will make it easier to provide an answer.
Yea i am making a 2d game, i have player and a enemy.I made script for enemy and get player node and set that enemy position =player.position
I can give you whole code if u want
If your enemy is a CharacterBody2D, then it is more advisable to move it with velocity so you can still have collisions instead of changing the position of the body directly.
Check out this tutorial Chasing the player :: Godot 4 Recipes
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.