Forum rules - please read before posting.

Flying and paths

Hi
Is there a way that I can make an NPC fly along a Path? The path itself supports vertical movement, and I've disabled gravity on the paths. I've also disabled gravity on the NPC. However the NPC doesn't appear to move up or down when the path Y axis changes.

The use case here is that I need some drones flying about, which will change paths depending on interactions, and clearly going up and down is part of that.

Here's a video showing what I see.
https://imgur.com/a/A5FTFT4

I've tried using rigidbody movement and without, but I've not tried with root motion on (I feel it's overkill as I just want dull cubes moving about). Gravity is disabled on the path and NPC.

AC 1.79.3
Unity 2022.3.4f1

Olly

Comments

  • You won't want root motion - that'll add more complexity into the mix.

    Sounds like you've done everything right. Could you share screenshots of the NPC's root Inspector? I'll attempt a recreation.

  • Hi @ChrisIceBox

    Here are the screenshots
    https://imgur.com/a/P4R2q7u

    I've added one of the Path object too so you can check the settings there.

    Olly

  • Thanks, with this I've recreated the issue.

    I'll issue an official fix in the next update, but in the meantime you should be able to apply a hack for it by opening up AC's Char script and replacing:

    if (!SceneSettings.IsUnity2D ())
    

    (around line 1932 in the latest release)

    with:

    if (!SceneSettings.IsUnity2D () && (GetPath () == null || !GetPath ().affectY)))
    
  • Line 1932 in v1.80.4 reads

    if (!SceneSettings.IsUnity2D () && flatten3D)

    Is that the one? Should I update to

    if (!SceneSettings.IsUnity2D () && (GetPath () == null && flatten3D || !GetPath ().affectY)))

    ?

  • v1.80.4 includes the fix - you don't need to amend it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.