Orient character mesh to surface

Since nobody has answered my previous question about faking wheel simulation, let’s try this alternative. Is there a way to orient a bone/mesh in a character pawn to the current surface angle? So far I’ve not found any nodes in blueprint that can do this effectively. And all the vehicles I’ve tried to make outside of the 4 wheeled vehicle bp just remain stiff and phase through surfaces, as well as not responding to any collision properties I assign to the mesh (other than the capsule component, and physics assets just cause the whole pawn to fall through the ground). I’m sure I’m likely overlooking something, but any insight or alternatives would be most appreciated

Hi, I answered a similar question earlier, see my answer in that post, it covers both C++ and Blueprint implementation. Hope this helps :slight_smile:

Thanks, I’ll try that tonight. I was reluctant to use the line trace method at first because I’m not sure how “cheap” it is…

Line tracing is really cheap :slight_smile: Even more so if you line trace only on 1 component, or if you line trace every X frame instead of every frame.

So I tried exactly what you had specified there, but for some reason my mesh (a big bulky tank) will come within raycast range and then begin flipping between the + and - side of the collision for each raycast. Resulting in the tank turning sideways, and the world being inverted repeatedly until I quit.

I’ll continue to test it and possibly find an alternative if possible, I’ll update you if nothing or something works

OK, weird. It should definetly not be moving to the other side of your floor, have you tried not moving the tank and just orienting it as a test?

Also, like I recommended in my other post, have you tried doing it with a simple cube mesh to try and narrow done the issue?

The only thing I can think of is that your tank may be imported differently, making it’s transform different or somehting…

In fact, it usually sends me to 0,0,0 even when impact point is the “new location”

It’s the “Normal” on flat BSP surfaces there are no hickups when on a flat untextured surface. And it does align to inclines, however once I am on an incline the camera flipping begins. So apparently we need another way to do this…

Fixed it, thank you Michael, you were very close. Take a look at the Random Foliage BP from the “Blueprint Examples” map that was released quite a long time ago. It has a section inside where it does a raycast by channel and uses a make rot from ZX rather than by axis, this is important because Z must always be facing up, where the Make Rot by axis doesn’t necessarily care. That may be why testing it with a cube gave you better results. This version of the BP, below, works exactly how I wanted it to. Again, thank you for pointing me in the correct direction.

i have do exact this but isnt effect any? Need i chance any stuff ? or do more as that

Its beginner stuff i think and no Tutorial on this can u Add this? to your lernpath on Youtube?)