I need to add the size of a part to a position while firing a gun so it appears in the right place. How do I make the vector that is added/subtracted the same regardless of the rotation or position of the player?
local H = ShootPart.Position + Vector3.new(5, 0, 0) -- ShootPart.Size.Z / 2
This code H adds a vector but it changes the location if the player moves. I need it to be consistent regardless of the rotation or movement of the player.
Are you able to use CFrame for this or are you forced to use Vector3 only? If you can use CFrame you can try
local H = ShootPart.CFrame * CFrame.new(5, 0, 0) -- ShootPart.Size.Z / 2
Assuming that ShootPart follows the direction of the player
If you can only use Position/Vector3, at the end of the calculation get Position from the CFrame to only get the Position of the CFrame
local H = (ShootPart.CFrame * CFrame.new(5, 0, 0)).Position -- ShootPart.Size.Z / 2