- Home /
Too subjective and argumentative
NPCs following an uneven floor...
I have programming experience but am brand new to Unity. Teaching myself via trial-and-error.
In a scene, I have a model with uneven heights that is serving as a floor and an NPC model that has no animation.
I'm trying to figure out how to move the NPC (sans animation) around the floor while raising and lowering the NPC to match the height of the floor at the spot where he's standing.
There seem to be many different ways I could approach this. I could move him with transform.Translate or I could put a rigidbody on him and use forces. I could keep him on the ground with gravity. I think CharacterControlelrs have some special properties that affect this. And so on.
I can figure out the details if I just knew which (in the broadest sense) approach is the most standard for this kind of thing? Should I be moving NPC's with rigidbody forces? Or by manually translating their transforms? Should I be using raycasting and terrain meshes to figure out when they need to "step up" or some other method?
Can anyone give me a hint? As I said, no need for details, just point me toward the right keywords.
Also, I haven't looked into animation at all, but it occurs to me that any tutorial that teaches me to make a walking animation might also cover how to handle the actual movement across uneven terrain. Should I perhaps jump into learning Meccanim and will find these issues are covered there?