News Forums RAIN General Discussion and Troubleshooting 3D Movement and gravity.

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  gabilua 1 month, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40637

    gabilua
    Participant

    Hello, I’m new to gamedev and I’m trying to make a simple enemy NPC in a level with several ramps and ledges that can be jumped over and fallen from. My NPC’s 3D movement is a bit off, with him not falling after he crosses an edge, but simply sliding through the air at constant speed from one height to the other, while still moving horizontally.
    Is there anything in the motor configurations that applies gravity to them easily or do I need to code it myself?

    #40638

    gabilua
    Participant

    I managed to solve most of it by applying a RigidBody and using the Character Controller Motor, with constraints in X,Y,Z Position and X,Z Rotation. I also added a capsule collider and it seems to be working fine when it comes to falling down.
    My problem is: It’s still hovering a bit above ground and after looking around I found this capsule mesh right where the AI rig is supposed to be, at its feet. May it be the cause of the wrong collision with the ground? Like, is he stepping on it?

    Image examples:

    View post on imgur.com

    • This reply was modified 1 month, 3 weeks ago by  gabilua.
    • This reply was modified 1 month, 3 weeks ago by  gabilua.
    #40642

    christougher
    Participant

    Yeah, find where in your character you have that capsule collider and disable it to see how it works. Some gameobject somewhere within the hierarchy has that extra collider on it.

    #40644

    gabilua
    Participant

    Thanks. Solved it.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.