I am trying to code a script where if the=is dude sees you he will come for you and chase you until you are a certain distance from him. I have tried numerous scripts to get it to look but he will not chase me around. Someone please help me so this dude can chase the player and catch the player and restart the game when touching the player.
Hi @Mason_Rocchio and welcome,
Check the following example, it shows how to move towards a point. You can use it as a base to have it follow a point that is also moving eg another dude.
thanks for the help I will let you know if it works or not
At least I now know how to get the object to move.
is there a script I can use to make the object move on its own
to random positions without keyboard and or mouse input?
Hi @Mason_Rocchio! I don’t think there is a ready made script for this. Below some functions that you can use to create your own script.
You can use math.random() to create a random position as destination.
You can use lookAt() to turn the character in the right direction. (Probably you need to rotate the model 180 degrees).
You can use translateLocal() to move the entity forward.
You can use distance() to check the distance from the entity to the random position to know of the entity has reached the destination.
I think I’m going to make a sample project with a basic enemy AI as this is regularly requested.
Ok, thank you so much for the help
cant wait to see the results.
please try to get it to me today
or at least try, no rush
I have something, but I have also a bug in it, so I don’t want to share it right now.
Alright, here you go. Probably not perfect, but at least it is something.
Ok thank you so much
dude this is amazing good job