Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Yanifska on November 10, 2013, 03:59:53 AM

Title: NavMesh UpdatePosition
Post by: Yanifska on November 10, 2013, 03:59:53 AM
Hi community,

In my top-down game, I have static cars that the player can enter from one side, and exit the other side.
When the character enter the car's door trigger he disappear and jump to the other door.

The problem is, it seems,  the character can't jump to the other side of the car, because the area is defined as not walkable in the LayerMasks.

One solution could be to change the LayerMask before the "jump" and reset it after.
The thing is it makes my project quite cluttered and heavy to manage, and I would like a solution that don't use layermasks.

I think the ideal solution might come from the UpdatePosition flag.
But I haven't been able to use successfully.
The UpdatePosition flag should disconnect the Agent from the NavMesh, thus allowing free positioning of the agent, but I don't get it right somehow.

I know it's quite a general question but nobody has been able to help me with that on Unity Answers and it is not well documented in the manual.

Thanks in advance for any insights
Yaniv
Title: Re: NavMesh UpdatePosition
Post by: Splankton on November 10, 2013, 03:26:25 PM
I'm just throwing this out there as an idea and maybe you've already tried it, but can't you set the property of the navmesh to disable, then get the position of the other side of the car, then set that position to your player then re- enable the navmesh?
Title: Re: NavMesh UpdatePosition
Post by: jeanfabre on November 11, 2013, 12:45:15 AM
Hi,

Have you tried AgentStop action and then move it manually? You get back to it using AgentResume.

bye,

 Jean
Title: Re: NavMesh UpdatePosition
Post by: Yanifska on November 11, 2013, 01:52:07 AM
I have tried all that, the Agent Resume (with stop update as well) move the agent back to its position before the Set Position. I can see my agent jump quickly. I tried to separate the agent stop and agent resume with a next frame event. Didn't help.
What am I missing ?
Title: Re: NavMesh UpdatePosition
Post by: jeanfabre on November 11, 2013, 01:57:01 AM
Hi,

 You should maybe recompute the path instead, but setting the destination again?

bye,

 Jean
Title: Re: NavMesh UpdatePosition
Post by: Yanifska on November 11, 2013, 02:38:53 AM
I do use SetDestinationAsGameObject after the resume action. Maybe I need to use ClaculatePath or ResetPath, or I don't know what  action will recalculate the path with the new position.
I remember I tried those a while ago without success.
I will try again, but with little hope.
Title: Re: NavMesh UpdatePosition
Post by: Yanifska on November 12, 2013, 02:34:37 AM
I can't get it working. Have any other idea ?
Title: Re: NavMesh UpdatePosition
Post by: jeanfabre on November 12, 2013, 04:24:06 AM
Hi,

 Nope... I'll have to see what can be done when I will work on this to update pathFinding support with PlayMaker.

bye,

 Jean
Title: Re: NavMesh UpdatePosition
Post by: Yanifska on November 12, 2013, 05:02:41 AM
I will stay with my LayerMask setup for now, it's kinda' workin'.