How do I add constant velocity to my pawn?

I’m currently creating a Star Fox-ish type shooter, I have my player and camera locked to a spline in scene, and was wondering how I would add velocity to player’s ship. only thing I can find is if you do it through an input node, but this needs to be a constant velocity that player doesn’t directly control.

Hey m2the1,

You can use Event Tick node to add a constant amount of velocity to your pawn. For example, if you’re using a Character class with CharacterMovement component, you can add something like this:

12545-constantmovement.png

Hope that helps! Let me know if you have a particular velocity setup that you need help with.

Sorry for delayed response. I’ve tried to set it up like this, but it still isn’t causing player to move forward. I have a pawn blueprint setup to lock to a spline and then set players forward speed on said spline. I’m not sure what I’m doing wrong.

Hey,

Sorry I didn’t reply sooner, but I was out sick last few days.

It looks like you’re adding 0.0 to your DistanceAlongSpline variable every tick, which won’t do anything. What happens if you put 1.0 in the + node?

Yes I’ve tried putting different values in that spot, but nothing seems to work.

Okay, then I’ll need to see how you’re setting everything else up. Where are you using DistanceAlongSpline float to move your pawn? Can you include images of relevant Blueprints? Thanks!

I guess that’s my question. How would I set it up to use DistanceAlongSpline to move player pawn forward? This is pretty much what I have so far in my pawn blueprint. I’ve tried adapting a few tutorials to meet my needs but haven’t been successful so far. I thought this setup would reference spline as world location of player in BeginPlay event, then tick DistanceAlongSpline variable and add players current position at DistanceAlongSpline with another float and then set that as new float for variable, increasing player’s distance along spline itself. Obviously that’s not working at this point so I was wondering where I was going wrong in my logic.

Well, no, all you’re doing currently doing is updating variable on tick, but variable isn’t being used anywhere else to update position of your camera. So if this is where all your movement is being handled, your camera location isn’t changing at all.

What you’d need to do is move your Set World Location node from Event Begin Play to Event Tick after Set DistanceAlongSpline node. You’ll probably want to smooth that per-tick transition using a Lerp or Timeline, but that’s basic idea.

Thanks for help. I’ll give it a shot and get back with you.