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

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

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.

Thanks for the advice, I have split everything up as well as I canI 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 pressThe 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