Add pawn velocity to actor

First of all, a lot depends on how you move your plane. If you do it using a timeline or any other type of interpolation, it seems as if the plane were moving, but its actual velocity value is zero, because interpolation just moves your object from one point to another with every tick, and in this case referring to your plane for velocity is useless.


If the plane is your pawn, getting velocity is not a problem.


Next, you may actually set an actor’s velocity upon spawning, just like this:



The question is, where you get that velocity to feed into the Set Physics Linear Velocity input.


So any additional data might be useful. What’s the plane’s function? Is it a pawn or just an actor? How is it moved?

I’m trying to make a plane that drops a bomb, but i want the bomb to inherit its speed for the pawn (the plane) and let the projectile movement do the rest. i have not been able to get this to work. So far i’ve tried:
Adding the pawn’s speed to the initial velocity in the actors construction script.
Casting for the pawn to the actor to add its initial speed to the speed of the pawn.

Any other ideas to get this to work?

The plane is a pawn, and for it’s movement i use the following nodes like this:

Forward movement:

Rotation:

This system is a modified version of the flying template from UE 4.20.

Can you do this?

But you have to adjust the spawning location so that your projectile wouldn’t spawn in the middle of your plane.

No, its says that my velocity is 0, 0, 0 when i do a quick print to screen of my “Self → Get velocity”. But i do have a current speed variable, is there a way to add this to the velocity?

How do you set the Current Speed variable? Normally you would do that by getting Velocity and getting Vector Length from that, but since your velocity is always 0,0,0, as you say, where does the Current Speed come from?


But I believe you can use that. You can get your Plane’s Forward Vector, multiply it by your Current Speed and you will have your velocity. But that will only work correctly if your Current Speed value actually corresponds to the Plane’s Velocity.

This is how i set the “current forward speed” variable:

And This is how i apply that speed to the plane:

You use Add Offset, that’s why you get 0,0,0 from velocity. But that’s fine; have you tried the thing with the Forward Vector that I suggested? That should do the trick.

I have tried in the following way:

But these are the values i’m getting when i drop a bomb:

From top to bottom:
Combined vector
Plane vector
Bomb vector

What I meant was something like this stuff:

Tried that system, and this is the following result:

The bomb still drops straight down with no velocity…

Well I don’t know than… try figuring out why this happens. Promote your bomb to a variable and try setting its velocity manually by key after a short time after spawning. Try adding a 0.1 seconds delay before setting its velocity. If any of these works, you’ll know that the problem is not in the bomb itself. If it doesn’t work, then the bomb is the problem, and you’ll know where to dig.


The second line you print — it’s the plane’s forward vector, right? Or is it supposed to be the bomb’s initial velocity?

The second line is the bomb’s velocity when spawned.
I’ll give all the options you’ve given a try and report back if i know more…

Does it work better if you set the velocity on BeginPlay instead of Construct?