Character Physics

Is there a way to copy the character physics behavior from BGE using Armory nodes? Basically how would you get an object to go up a ramp without falling over?

Of course you can program character physics in Armory, but you can not import/convert your BGE bricks/python code.

What would be a good way of going about it? I’ve tried restricting the character’s rotation using a constraint so that they don’t fall over going up the ramp but it doesn’t seem to be working. Their bounding box is a ridged body.

Constraints don’t work in Armory (yet, no idea when Lubos is gonna do them he said they’ll come sometime). In the Rigidbody setting go to Armory Probs and turn the X and Y angular factor to 0. Now your Rigidbody can only rotate due to physics on the Z axis (and should not fall over when standing on slanted ground).

I tried that, but they cant go up the ramp at all, it just runs into the edge of the ramp. I’ve also tried translating the object along the slope, but that only works without ridged body, so if the angle is just a little bit off it ends up going through the wall.

This is the setting I’m trying to copy, it was real simple in BGE but I haven’t figured out how to do it in Armory.

If you want to prevent the rotation you can control the angular factor to prevent the character from rotating when reaching a slope, by simply setting to 0 an axis you can lock it, so if you set angular factor to (0,0,0) the character will not rotate by physic simulation.

You can check the templates to see some examples of character controllers for different purposes. They use Haxe traits though, but I think the logic may be doable to some extent with logic nodes, but I’m not sure.
Also I think there are some examples in this forum too if you search for character controller.

Basically you move a rigid body around setting its velocity and apply impulses if you want to jump, you then apply some controlled gravity when setting its velocity, and if you want to recreate that behaviour from the video where it doesn’t slide down, you may have to add additional logic to apply gravity dynamically depending on some condition, normally the angle of the slope. So if the angle of the slope is less than X when static, gravity is not applied.

That is really weird, are you sure you did not change the Linear Factor as well? Try and see if this controller can go up ramps for you, if not that is some strange bug. You need to put logic_pack next to your .blend, or delete the nodes that show up red. These are responsible for camera vontroll so not interesting right now.
pWaM1.blend (1.1 MB)