What's the deal with RotateVector in the First Person template

Hello!

I apologize for the basic question, however the documentation isn’t really helping nor is the comments in the First Person Template helping either.

In the BP_Weapon_Component, in the shooting event,

There is this set of nodes:

Most of is it is self explanatory to me except for the RotateVector node with the projectile offset and the camera rotation.

Why does unlinking the GetCameraRotation from the RotateVector node make the balls spawn in a different position based on the rotation?

While Linking that node makes them spawn in a static location.

Thanks!

GetCameraRotation is returning a unit 1 vector which is pointing in the direction the camera is facing. But it ‘lives’ at the origin ( 0,0,0 )

A 1 unit vector is no good on its own, so we need to multiply it by ‘projectile offset’, which is the distance in front of the camera we want it to spawn.

But even the result of that calculation is living at the world origin, until we add it to the location of the launch point, ie, the gun socket. This couples the calculations to do with angle and distance, to the actual spawn point.

Does it make sense? :slight_smile:


Attempt #2 ( I didn't actually answer your question )

The rotate vector node is supposed to be taking the projectile offset and orientating it correctly. But yes, I think it’s totally possible to just take the camera vector, multiply it, and add it to the socket :smiley: