Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: MajorIdea on May 15, 2019, 12:57:38 PM

Title: GetParent with EveryFrame[SOLVED]
Post by: MajorIdea on May 15, 2019, 12:57:38 PM
Hi,

I'm doing a Raycast that stores the Hit Object and need to get the forward vector of it's parent. The problem is it I can't get out of the state.

There seems to be no way to do a Get Parent more than once inside a state.

I've looked in the ecosystem and tried to edit the script with no success.

Would such an action be possible / a good idea?
Title: Re: GetParent with EveryFrame
Post by: Thore on May 16, 2019, 01:36:04 AM
Sounds like a bad idea. Finding, and getting game objects, getting components and suchlike are usually treated as expensive and not done every frame.

You could make it so that whatever changes the parent...

Another way is setting up a loop with a short wait timer. Put a wait action on top of the state, and have it send an event that routes to the same state, but be sure to set a time greater than zero.
Title: Re: GetParent with EveryFrame
Post by: jeanfabre on May 17, 2019, 01:32:04 AM
Hi,

ok, I made a GetParent2 on the ecosystem which will give you the everyframe option.

I do agree that this might be a bad idea, but I am also sometime confronted with this where a single state flow makes more sense and is easier to work out.

Bye,

 Jean