i have a problem that when i spawn an actor and attach it to a socket in my character’ skeletal mesh it works fine but when i detach it . it disappear.
in my case i’m trying to spawn an arrow when i press the right mouse button it spawn the arrow and when i release it the arrow takes off, but when i release it it disappears .
when i spawn it i set the velocity to be 0 so it doesn’t move and when i release it .
i set the velocity of x back to 1 so it moves the problem is that it doesn’t move.
You can do that by taking the direction of the raycast (normalized), multiple it by the speed of your projectile component’s speed then use that to set the projectile’s velocity.
it was the first thing i have tried .
the arrow moves parallel to the ray cast .
i want it to move to the hit end so the arrow and the line trace meet at the end
Ah, I thought they started from a similar location. If that’s the case create a vector by subtracting (EndLocation - ArrowLocation). Normalize that vector.
Then multiple it by the speed and set the velocity.