Moving Actors

Hi all,

I’m attempting to set an actor that has a constant speed forward along a default x-axis but can extend movement on the x-axis either forward or backward without moving the camera’s position on the default x-axis.

Any help please?

I want to retain their x-axis but
enable offset movement on the X and
Y-Axis. Any help please?

You probably meant the Z & Y axes here

The Pawn with Floating Movement Component:

Above, you change the speed by altering the Scale Value. And you can right-click pins on the nodes to split them into individual components. The input:

Hope that’s it!

Image from Gyazo

A valiant attempt at making this minimalistic:

Thanks for help! You’re right, I have the terminology wrong in my question, I’m attempting to describe an actor that has a constant speed forward along the default x-axis but can extend movement on the x-axis either forward or backward without moving the camera’s position on the default x axis.

Like this then perhaps:

You move at constant 1000, forward moves you faster, backward slows you down.

Play around with this, see if it gets you any closer:

Image from Gyazo

Great, it’s a similar effect that I’m after here with the camera and actor sharing a constant speed 1000 with the exception the actor can “rubber band” forward or backwards from the default position on the x-axis without the camera following the actor and when the input is released the actor would spring back to the default position on the x-axis where the camera is.

Everynone, that’s incredibly helpful. I’m attempting to get the components to function the other way around actually, so the camera’s spring arm isn’t altered but instead the pawns screen position is maneuverable on the x-axis, while the pawn moves at a constant 1000 pressing forward would take the pawn above the camera’s center line, pressing back would take the pawn below the camera’s center line.

Switch them around then, make the springarm the root component and attach a mesh to it. Speeding up would then increase the relative offset in X. Even easier to control this way.

To clarify:

Instead of camera, it’s the mesh that is getting offset.

Everynone that’s working, thanks! The mesh is now being offset but it’s using the Upper and Lower Speed Limit, is it possible to get the offset without changing the constant speed?

Not sure if I follow.

Constant speed is an average of Lower & Upper - you can set it to whatever value you need instead.

The offset does not use constant speed. The offset is generated by the MapRange node. The node takes lower and upper values and translates them into the 500 - 1000 offset range.

When you travel at Lowest velocity, the X offset is 500; when travelling at the Upper limit, the offset is 1000. The fInterp will try to reach target speed value every frame little by little using the Interp Speed as its exponent.

It’s parametrised for consistency reasons, but you do not need to use variables there. Feel free to punch in values manually. Negative values are OK, too.

You can set the Out Range A to -500 and B to +500 → Lower velocity reduces the offset, high velocity increases it. Average velocity would set it in-between, in this instance to 0.

I believe that’s what the attached image visualises.

Yes, I’m able to get the offset but as you can see, the offset movement is also altering the constant speed. Are the MapRange offset variables a forward vector?

314838-myfile.gif

the offset movement is also altering
the constant speed

No, it’s not. It’s the other way round. The offset depends on the speed, it’s derived from it. Perhaps attach a screenshot how you wired it up.

Image from Gyazo

At default speed, the offset is 0. At max speed, the offset is 500, and -500 when slowing down.

I’m thinking it might be to do with the existing Movement and Rotation of the pawn???

If you’re adding movement on Tick, you’re moving the actor twice. The script I posted already does all the movement. The input axis fires every frame, just like Tick does.

You could keep the rotation on Tick, or hook it up to the axis event. Just ensure you do not accumulate more movement than you intend.

Could you tell me how InputAxis MoveRight would be implemented, as the pawn’s Y Axis movement doesn’t look like it takes in to account the distance in the world of the pawn’s X Axis offset and is able to move to the same Y Axis screen position within the same duration of time no matter distance of the offset.