Forum rules - please read before posting.

Easiest way to set NPC rotation as he moves along a path?

I have a crocodile walking around, when he goes down slopes that I define using a path, Id like him body to sort of tilt say 45 degrees so he looks like he is going down the slope. With the ordinary path things following the path dont actually rotate at all so it can look very unnatural at times (and parts of him go through the ground), is there a way around it ? Perhaps it would be cool if the path could take into account the rotation of the node itself somehow.

Comments

  • Actually having a similar problem with a caterpillar that im trying to go up a wall, he seems to be rotating to some axis once I start the game, despite me having pre rotated hm, I also tried putting him in a rotated parent object. I guess my question is what dictates the rotation of the NPC when it is following a path?

    thanks.
  • When NPCs move along a path, they do so on the assumption that they only ever rotate sideways, and never up/down.  A caterpillar moving up a wall would be better done by animating the movement using Unity's own animation tools, and not by relying on a path.

    It may be possible to add a "tilt rotate" option in a future release, but not at the moment.  The only option at the moment would be to use Mecanim to play manually-rotated animations based on the character's vertical movement, which you can output to a float parameter within the NPC / Player inspector of any Mecanim-based character.
  • OK thanks, I was going to use a path because you can use isRandom so no one can predict it :) I think it would be a very useful option for the future if you could add a rotation for the character to to take on a node on a path, or however you see it best working. With that there would be a whole world of new sprite options available, both my croc and my caterpiller would be rocking too :) Thanks again for the support, you must be working like crazy since the new influx of people, but its fast becoming one of the best assets out there.
  • Yep,
    Now it,s quite a messy thing
    Im having problem where my Npc before simple walk down along path always turns for 0,5 second right ant it looks bad :/
    Hope some adjustment will be added soon.

    Thanks
  • And its verry strange becouse before walking down 
    (via almost stright down path).
    NPC is already facing down (so what for is he turning on ?).

    Maybe it's some kind of bug ?

  • OK,
    It looks liek it was a bug.
    Reaplaced NPC with prefab of his 2 nd instance (from diferent location)
    and now no problem with strange rotation.

  • Ok,
     I figured out this thing even further,
    (for those with same problem in future).
    option "ingore gravity"
    shoud be checked.
    If not than NPC is rotating strangely when starting walk along path.

    Anyway it was like that in my case.

  • So this is fixed for you now?
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.