playMaker

Author Topic: raycast for 3 seconds / animation  (Read 1544 times)

kryptopath

  • Playmaker Newbie
  • *
  • Posts: 10
raycast for 3 seconds / animation
« on: November 18, 2014, 04:30:20 PM »
hi,

i have a room with some infopoints (oculus rift). when the user looks at this points for 3 seconds or the duration of an animation an info appears. i set up a raycast to check the gameobject i am looking at. if this is the same as the info-object i start the animation and activate the plane with the info. but... how do i stop the process, if the user looks away in this 3 seconds? i tried to check again after the 3 seconds, but the value in the variable has not changed, even if he looks away, so the process starts anyway. i tried to place othe gameobjects, so the raycast picks up other gameobjects so the stored value changes, but this ends up in a loop.. is there some easier way to set up this up? look at object, start animation, check if he is still looking, show info. if not, return to start-state.

Sly

  • Full Member
  • ***
  • Posts: 123
Re: raycast for 3 seconds / animation
« Reply #1 on: November 18, 2014, 06:55:23 PM »
In my opinion I would set an FSM "Radar" for checking what the player is looking at. The raycast should detect any tag; and an other FSM with your delay. If your gameobject is not equal to the correct one, it will leave this state.

I think you could have other way, but separate this in two FSM should be a good direction I guess.