playMaker

Author Topic: How check (test) the position ! when object move to it ?[SOLVED]  (Read 3646 times)

eotiti

  • Junior Playmaker
  • **
  • Posts: 65
How check (test) the position ! when object move to it ?[SOLVED]
« on: February 18, 2014, 04:56:13 AM »
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 ?
« Last Edit: February 19, 2014, 03:38:01 AM by eotiti »

redikann

  • Full Member
  • ***
  • Posts: 174
Re: How check (test) the position ! when object move to it ?
« Reply #1 on: February 18, 2014, 08:15:35 AM »
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

  • Junior Playmaker
  • **
  • Posts: 65
Re: How check (test) the position ! when object move to it ?
« Reply #2 on: February 18, 2014, 10:22:43 AM »
redikann
you can tell me detail more ?
some logic you can tell me what action use in here ?

eotiti

  • Junior Playmaker
  • **
  • Posts: 65
Re: How check (test) the position ! when object move to it ?
« Reply #3 on: February 18, 2014, 10:18:50 PM »
any one ?

redikann

  • Full Member
  • ***
  • Posts: 174
Re: How check (test) the position ! when object move to it ?
« Reply #4 on: February 18, 2014, 11:36:12 PM »
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.
« Last Edit: February 18, 2014, 11:41:10 PM by redikann »

redikann

  • Full Member
  • ***
  • Posts: 174
Re: How check (test) the position ! when object move to it ?
« Reply #5 on: February 18, 2014, 11:46:58 PM »
Pic

eotiti

  • Junior Playmaker
  • **
  • Posts: 65
Re: How check (test) the position ! when object move to it ?
« Reply #6 on: February 19, 2014, 02:29:34 AM »
oh thank redikann i got it
so if i want to send even when Float =0
what action i will use to send when event Float = 0?
« Last Edit: February 19, 2014, 02:45:26 AM by eotiti »

eotiti

  • Junior Playmaker
  • **
  • Posts: 65
Re: How check (test) the position ! when object move to it ?
« Reply #7 on: February 19, 2014, 03:37:36 AM »
oh i did it
i use : Float complerator to do it
Thank redikann again