how to make a object follow the playe?
Printable View
how to make a object follow the playe?
Short answer: Make it use bouncing ball movement and always look in the direction of the player.
yes but i want the object go to the player when is close not all the time thankyou
"Enemy" X-position < 100 from "player" X position -> Set direction to "Player". I don't know if that works, but it sounded pretty basic. Oh, and the same for Y position. No... I doubt it will work like that. Well, try playing with X and Y positions.
That would work for checking distance in one dimension, though I'm not sure how you're wanting the distance calculated... if you want the object to detect when it's a certain distance away in two dimensions, look at the Distance Formula on the two objects.
The distance between the two objects = Square root(X(("Object 1")-X("Object 2"))^2 + Y(("Object 1")-Y("Object 2"))^2)
You'd then check the result of that formula against the minimum distance you want to detect at before allowing the object to follow the player.
it doesnt work it set syntax error whit that formula .
you know i did that before in multimedia fusion 1.5 but
i dont remenber how .
You will get a syntax error if you paste it directly. Look at the expressions available in MMF2, replace the names with those of your objects.
you know i have this two objects
1(zombie
2(player
I want the zombie follow the player when it gets close.
so you are telling me to replace zombie for object 1
and player for object 2, True or False
thanks
like this
(X(("zombie")-X("player"))^2 + Y(("zombie")-Y("player"))^2)
syntax error again
sqr((X("zombie")-X("player")) pow 2 + (Y("zombie")-Y("player")) pow 2)
Im sorry but syntax error again daniel ,i think it cant be do
im puting the same code in the zombie x position but apear syntax error, im geting crasy whit this.