PlayMaker Help & Tips > PlayMaker Help

How check (test) the position ! when object move to it ?[SOLVED]

(1/2) > >>

eotiti:
hi guy
i have a position is : 0.0.5

i want to check when my object move to 0.0.5 it will send event .
but i don't want to create trigger or colision ....

so, how i can check if i don't use trigger ?

redikann:
You could get the world position of a game object at anytime and use some logic to do a vector 3 compare. You would probably have to do this every frame.

eotiti:
redikann
you can tell me detail more ?
some logic you can tell me what action use in here ?

eotiti:
any one ?

redikann:
Well you can start by using a "Get Position" action on your Gameobject and setting it to world space and every frame. You will have to save this to a vector 3 var. You would also need to put an empty Gameobject at your desired location and get its world position just like your main object. You can do this all in the same FSM state.
Now if you look in your vector3 action browser there is a "vector3 operator" action. Select this and supply your two vector 3  variables and choose distance. save this to a float var and when it reaches zero you should be there.
Actually I think you can just set the 2nd vector 3 coordinates (0,0,5) in the operator action with no need to get an empties position.

Navigation

[0] Message Index

[#] Next page

Go to full version