playMaker

Author Topic: Continually update raycast location?  (Read 5008 times)

Destek99

  • Playmaker Newbie
  • *
  • Posts: 5
Continually update raycast location?
« on: August 19, 2019, 06:00:21 AM »
Hi, I am working with the Oculus Go and I am a bit stuck on raycasting.
I am using the Oculus Go custom actions by @HendrikB as well as the "draw line" action from the ecosystem.

My current FSM looks like this



The draw line lives in the "Raycast" state, so I guess there needs to be a loop in there somehow so as long as the "Oculus Go Dpay Button" is down then its continually updating the location of the "End OFfset" of the draw line action

But I am stuck as to how to do this

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Continually update raycast location?
« Reply #1 on: August 19, 2019, 06:52:49 AM »
First thoughts are splitting it up.

For example I've made automatic (hold the trigger) weapons in the past where the trigger itself is it's own FSM which simply updates a bool. So you press, goes to next state which is bool on, when you stop presssing, goes back to first state and bool is flipped back to off. That's it. Then another FSM sits in a state where it gets the bool (from the first fsm) every frame, and then moves to the next state when the bool is true. This next state can do an everyframe or a loop because it also watches for the trigger bool to be false, at which points it exits back to the idle state, etc.

That action doesn't have an 'every frame' option though. I don't know how it works. Thing is about making it a loop, there is a limit of how many time it can repeat through the same state before it halts as an endless loop error. A way around this is to use a Wait time between cycles or Next Frame Event.

Destek99

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Continually update raycast location?
« Reply #2 on: August 21, 2019, 09:34:37 AM »
Thanks for the advice, I have split everything up as well as I can
I now have the following

My setup is as follows,
A raycast in its own FSM


A bool loop as per your recommendation


And a drawline fsm on trigger press


The final FSM does work as its correctly drawing a line to the object location that has been hit by the constantly firing raycast FMS, and also destroys the line as part of the 3rd state. However when I try to send an event as part of this it never reaches the intended object

, it seems that "RaycastHitObject" never populates which I have confirmed from the globals window


Any ideas why this might be? Thanks.