I’m trying to make a game similar to a screen shot.
The player rotates only one axes.
And the player moves only forward, backward, up, and down.
If the player’s front wheels don’t rotate left or right, they will go just straight.
But an external shock will cause the player to rotate, and eventually run in the wrong direction.
to correct it. This kind of tick arrangement means the player will always tend ( every frame ) to go back to the initial Z setting.
If you want to correct more settings, like a vector rather than a float, you can use the same setup but with vinterp.
I think it’s the player controller you need here, it might be the character…
I’m suspecting that it might not be enough. If the player gets knocked off course, the Z will correct, but by that time they will be slight off to one side. In that case you need to interfere with the code I was talking about above, the actual player control code. Just don’t let the left/right stuff happen.
I’m testing from the Vehicle Advanced Template in UE4 4.22.3.
I succeeded by modifying the method you told me, but there is a problem.
x,y,z all the rotations are locked.
The vehicle always tries to keep level.
But location limit works properly.
When I connect the GetPlayerController to the GetActorLocation, I don’t know why the player pawn’s position changes when I play the game.
But disconnect, it works fine.
I’m trying in many ways, but I haven’t finished it yet.
If I use splines, won’t there be problems with the jump?
Hi - Are you saying you can’t control the rotation? I notice your getactorlocation is not connected.
The controller controls the pawn, I - think - you’ll find if you try and affect pawn rotation directly with the pawn it wont work ( could be wrong ).
If you use a spline along the middle of the track, you can always let them do what they want, but you always know where to pull them back to. You don’t have to worry about ‘crawl’ where the coordinates gradually get more errors over time.
On the spline, you can let them do as much Z as they like, but get a grip on the XY.
I made the z-axis stop spinning only but the result was that all the axis of rotation stopped.
If the x,y connection of the GetActorRotation is disconnected, the result does not change.
When the GetPlayerController and GetActorLocation are connected in the event Begin play, the vehicle is spawned elsewhere when the game is started.
When the GetPlayerController and GetActorLocation are connected in the event Tick, the vehicle slowly comes down in the air and goes through the floor.
When the GetPlayerController and GetActorLocation are disconnected in the both events, it works good.
I don’t understand why this is happening. haha
Can I use splines to move the x,z-axes freely and limit the y-axis only?