I’m walking on a tiny planet. Unfortunately, I get stuck on the bottom of the planet and I’m not sure why. I think the axis are getting crossed for the forward vector.
It is a simple blueprint. It orients itself towards the center of the planet. This is using a floating pawn that orients itself to the surface based on the distance from the center of the planet. It keeps getting stuck.
It will be your code, somehow
I did this ( tiny planet ), and rather than using a vector to the world center, I did a line trace down from the pawn capsule, and took the normal of what was underneath.
It works much better, I find. And, you can go up and down steps etc.
I appreciate the reply.
Okay. I guess I should start from the top. Because watching some hacky youtube videos isn’t working. I made my own hacky solutions in unity years ago but they were dependent on the geometry not having harsh slopes but it created a rough f-Zero GX feel. The same solution you mentioned linecasts/raycasts but dealing with rotation snapping with lerps was problematic. I still wonder how it is done in F-Zero GX because it is virtually flawless.
So the problem with using normals for a planet is that you end up aligning to the hills.
The bigger problem I am trying to understand is pawn movement. Can pawns or characters behave normally when their forward vector is not locked to the ground plane? Because it seems like forward movement is locked to a plane. And that pawns and characters use some kind of faux physics. Yes I’ve already read through the unreal descriptions of pawns and characters that doesn’t help with knowing what you can and cannot be do with pawns or characters.
Do I need to just build my character interactions from a rigidbody? (that is what I had to do with unity to get the control that I wanted)
If you’re going for an F-Zero feel, then your approach is correct.
Don’t use ‘character’, is has gravity. Pawn can fly along like a car / ship.
So we’re back to getting stuck on the bottom of the planet, which must have something to do with your code, because you can run it without a planet there.
What is the gist of it?
It is a variation of this but with FPS. https://youtu.be/bEWgGnq5h7c
I think he has a similar problem at https://youtu.be/bEWgGnq5h7c?t=1388
But he tries solve this by using the camera’s forward vector. This doesn’t work for me.
At the moment the user cannot actually rotating the pawn just the camera.
So this creates faux gravity. The rotation align to the planet for the pawn is based on the position of the pawn and the location of the world origin.
I tinkered around with this for a while.
I don’t think it’s a great tutorial. He’s setup a system that’s fighting itself, basically.
If you want a ‘pawn’ that rotates around the planet, and doesn’t take hills into account, then I’d just use a pawn that has it’s center in the same place as the planet, and extend the player mesh to reach the surface
Then all you have to do is rotate the actor.
But it really depends on where you’re going with it…
I need hills. And spinning the actor or just spinning the ground would cause problems. I don’t like the tutorials solution either. It feels incomplete and hacky.
You can still have hills with a down trace
So the basic movement is rotation, but you can lengthen the radius the player is at depending on a down trace.