Is there a way to make set actor rotation node work if my pawn has physics enabled? Because it seems i can affect my pawn with linear-angular velocity, but i cant change it’s location/rotation manually with set rotation/location at all.
It might be a wrong idea but you could use vector. Have you tried setting lookup vector for your physics enabled actor? Or you could grasp the idea on this 6-DOF movements tutorial.
Yeah thanks for the advise, I’ve seen this one. The thing is that i want to make the pawn hover over the ground, and i managed to do it more a less. But i also want it to be affected by the slope of the surface it’s hovering over. And tilt it based on that. And i don’t seem to get how can i set the rotations for the physics pawn in tat case.
That being the case you should figure out the normal vector on that surface. I do not know that UE has the functionalities. But you could get the normal vector using two line trace between two spots. With line tracing you can easily find the difference of the altitude. And you can calculate the slope from that difference using vector. But this approach is acceptable on 2d.
Anyhow did I get the point of your question??
yeah i am tracing that normal, and i know witch angle should it be. I actualy made it work on a character BP with my hover car inside it. Everything works just fine there.
But i can’t make it work on a physics pawn, since i cant control rotation or location, and i need to affect it with velocities linear/angular velocities only. When i try to set rotation with “set actor rotation” node on a physics pawn it just ignores it.
So my question in other words is can i affect my physics (with enables physics simulation pawn rotations in any other way? For examle can i simulate only transforms but still have manual control over rotation of my pawn? so i can affect rotations with variables instead of forces and velocities?
This is my setup for rotation so far. I’m tracing the ground normal under the vehicle and getting the proper rotation for my car from it and trying to rotate it with set rotation. and it doesn’t wanna work if i have physics enabled. only affectig the angular velocity in a same way works. but that’s not what i need in this case.
any hints guys?
How are you determing the rotation before you make rotation.
I think if you do a line trace from the front and back of the pawn and get there distance from ground you could use a finterp function to give you a inbetween rotation. Im not really good with math. I would subtract start trace location minus hit location then get length of vector then say if length is less than hover hieght start rotating pitch until you reach target length do this for both front and back traces and i think that should work. et me know if that works. I think back would rotate positive and front would rotate negative.
Hope this helps let me know if it works please!!!
I realize this is an old thread, but i found a decent solution to this issue for any others that might come across this. In your root object, you will have the phys body with simulate physics enabled, but then, as a child of that component, you can have what i named a RotationDummy scene component. The rest of the actor’s components are children of the rotation dummy component. this allows me to control my actor with physics, but explicitly control any other aspect of the actor that is a subcomponent of the rotation dummy using the rotation dummy local or world transforms.