I’m working on a very simple vehicle AI which tries to run down the player. But some times the vehicles collide to each other and are launched in air a bit and land upside down or sideways … refer image for that.
I suppose it is safe to assume you do not want to force a transform on the object and say drop it from above with a corrected rotation?
This seems to me acceptable given your game design perhaps?
If you are looking to rotate it and get along with the physics system, that will be a different matter. Still feasible, let me see here…
You can surely do it by adjusting the required parameters to the system to allow it to slip easily and use far less force to force a move on it. I have not played with doing that yet tho.
I was able to get pretty smooth results by simply using RInterpTo combined with set actor rotation I have the ‘Teleport Physics’ checked and it seems to work really nice.
So I simply implemented reset for the vehicle, where I force it to over time correct the rotation to an empty rotation.
I can jus spawn it with correct orientation given the current style and theme of game. But I was trying to jus reorient the car similar to the game in which cars jus get on wheels by themselves(in a racing game maybe).
even if I considered to spawn the car with correct rotation, how do I detect that after spawning, it will not overlap with something. As in the image, if I spawned the car again, it will get into house walls.
you can do a box trace where you want to put it and shift the result by any collision information you detect. Because yes, the teleport below may also act funny with local geometry collisions. Didn’t test that.
But the below does do a nice slow rotation that you can tweak as desired, just need to verify how it acts against collision with teleport enabled.