Adding vector to location

I’m trying to offset the starting location of a projectile from my player by a certain distance in front of the player in the direction of the camera’s view, but I’m having difficulty.



[java]cannonballNode.setLocalTranslation(cam.getLocation()+cam.getDirection().mult(2));[/java]



Keeps telling me I can’t add a vector…



Is there some way to normalize the cam direction, scale it and then add that to my cam location to get the local translation I need to have my cannonball appear just in front of my character?

the “+” does not work on objects.

Use the Vector3f add method



cannonballNode.setLocalTranslation(cam.getLocation().add(cam.getDirection().mult(2)));

Awesome, thanks. It’s working the way I want it to now. :smiley: