How do I restrain physics to a certain axis?

I wanted to set up a character that could skate down hills and bleed off velocity when skating up hills. As far as I can tell, the character movement component does not include any settings that could help - so I ticked on the simulate physics option on a capsule component.

However, by doing so the player now falls over immediately. I experimented with using a tick to lock the character rotation - but that caused the character to vibrate.

Anyway, is there a way to set select axes on an object to kinematic?

Thank you!

I have spent some time using the physics constraint component to achieve this result. However, I am not having any luck and the character keeps tipping over. Any help would be appreciated.

Hi rosenkranz,

We do have a feature to lock the axis of physics assets and blueprints coming in a future build. We are using it internally and it is in the Master branch on Github if you are building your engine that way (just be aware that the Master branch is still being tested).

If not, one way to achieve what you want would be to use the physics constraint like you are doing and tweak the friction. To stop the character from falling over you could sandwich the track in between 2 Blocking Volumes.

Another way would be to go back to using the character blueprint like you were doing at the start. Create your player character then adjust it though friction and blueprints. A good place to start for ideas on how this could be done is the new Blueprint Rollingball Template.

Thanks, TJ

Lock axis does not work if you want to fly down hills and such in 3d, is there a solution in the works for that?

Hi signod,

What exactly do you mean by fly down hills? Something like skiing with low friction?

If you lock axis, and you try to move in that direction, it is locked, i guess what im kinda looking for is a “lock rotation” button for physics

I would like to FORCE an object to stay upright when i am simulating it

The application i am trying to use it for is when i use the movement component from the first person template, i can either use the default movement component, which allows me to walk, OR fly but not walk and for example, boost up or use physics on the character

Or, simulate physics on the root capsule component, that allows me to use set physics linear velocity and the various physics functions to make a useable jetpack in 3d, i can boost up, down left right ect, and when i fall to the ground, i can use it to go forward

HOWEVER, this makes the capsulecomponent fall over, because it is simulating physics, the only solution i have found to it is to set the rotation on the capsulecomponent to stay upright during every event tick, and this causes some weird issues that i assume would not be there if you could sim physics on it without it falling over

EDIT: I realise i may be going about this wrong, but i have been attempting through irc and answerhub to get the “right” way of making the movement component able to fly but i guess the real issue is gravity

If i simply used set location to fly, i would need to manually set all the physics options myself, the drag, the acceleration, gravity, ect,ect

For everyone who’s wondering about this new feature, I suspect it was constraints, which are now old features. The answer is to use the X and Y rotation constraints. Just make sure your movement forces overcome the friction or it will look like you are stuck.

96733-untitled.png