Cannot Simulate physics AND set rotation

Try setting the rotation just before simulate physics, not sure exactly what you are aiming for but try something like this:

You could even add a timeline to set the rotation over time or add in a delay and so on…it all depends on what you are trying to do.

In building a pawn I came across this issue, yes there are other questions like this one but none of them were complete/good.

Whenever I use a static mesh I can simulate physics AND set the rotation, but when I switch to a skeletal mesh I can only simulate physics. I need to switch to a skeletal mesh because animation is not supported with static ones.

Any help is greatly appreciated!

Don’t know if this will work but it seems rather shaky. I am trying to make a helicopter and I need to rotate the mesh for control but also set linear velocity at the same time.

EDIT: I tried this and it did not work, any other ideas? I have a feeling that it won’t be possible.

Oh ok, do you need the rotation constantly updated (or player controlled?) or do you need it set and maintained at a set rotation…like turn “north” and continue to face that direction?

Ok, I was thinking you needed to have it turn and face a certain direction before falling into the simulate physics like flip it over onto its back and then go ragdoll kind of thing… with it being a helicopter why do you want to simulate physics and try to control the rotation at the same time?

I need it to be constantly updated and lerp between rotations. I am using mouse input for rotation.

I want the person playing the game to be able to control the helicopter. Because I am adding force in the up vector by turning the helicopter I essentially steer the helecopter

Thanks for the reply. Will the add Actor Local Rotation work with Simulate physics? Basically this whole problem is caused by animation. When I used a static mesh I could simulate physics AND rotate, but when I switched to a skeletal mesh (which would let me use animation) I could only apply physics and NOT rotate the skeletal mesh.

Just so I understand completely what you are trying to do…
You want to setup rotation control for a ragdolling (simulating physics) helicopter so the player can be in control as it is simulating physics and you will be adding force to it in the +Z at the same time. Correct?

Will you be using any animations with the helicopter?.. I see that you mentioned that in your question but simulating physics will most likely override some of the animation results if it isn’t setup correctly. Which brings me to my next question. Have you setup any PhysX Constraints?

This documentation will help a lot if you haven’t already taken a look:

If it isn’t setup correctly there will a lot more back and forth on this and I want to make sure you get this working the way you it to be with as little frustration on your part as possible.

Once the right constraints are in place to keep the model stable and not possibly trying to fall/pull itself apart one of these (depending on what works better for the BP you’ve setup) should work within the BP to set its rotation since you aren’t using any movement component:

The Input Axis Event updates/fires every frame of the game so this will allow for the rotation to also be set/updated every frame of the game this just shows the Yaw rotation value but the same can be setup for the pitch and roll. The input comes in from 1 to -1 so adding to the rotation it will work in both directions, the adjustable turn rate variable will allow you to make adjustments to the speed that it is rotating. You can just plug the input Axis Value float directly into the rotation float pin…that may work for what you want as well and with a mouse input it may be the better way to go but at least you know if either one doesn’t work quite the way you want you have options. To set the simulate physics you just need to use the node or check the bool in the mesh details panel.

P.S. I had to post as an answer because I was over the limit for a comment apparently

It should work with it but I just wanted to make sure you had all the information you might need to get in the right direction, try it and let me know if it works, if not look into the information I gave you to make sure the model is setup correctly for the physics behavior you are after

I’ll let you knowif it works, when I can get on unreal. I’ll try to get on tonight. Thanks a ton for the help, I hope I can get this sorted out!

Sadly, I just tried all of those with no luck. I don’t think it is possible to rotate an object with simulate physics on. Rotating the mesh probably conflicts with the physics and is simply not possible. I found AddTorque and it works but its hard to constrain. Any ideas?

EDIT: Checked the docs, physics have been set up correctly.

UPDATE: I have gotten AddTorque to work! Yet there is still one major problem; the acceleration from AddTorque is really messing with the steering, for I do not want the helicopter to keep rotating after the player stops moving the mouse. How can I “Take away” the acceleration after the player stops moving the mouse (i.e. input from mouse axis is zero)

Would there be a better option?

Well I need to apply lift in the local up (basically go up) so I use set linear physics velocity. I need to turn the helicopter so I use AddTorque.

Increase damping amounts

Just for sanity sake…why do you want it to be simulating physics?

That all depends on why you are wanting it to simulate physics the way you are trying to do.

OK, I don’t think you quite understand exactly what simulate physics does…so. Yeah, setup animation states and custom movement…feed the values of the custom movement into an animBP to determine which anim to play. This should get you started on the movement: To add the up movement you can use a AddLocalOffsetNode :

To turn you can use:

And to move forward:

That is the way it is done…every frame take a look at the templates they all update movement every frame…that is how it is done.