Let's say you have an horizontal object constantly shooting another object horizontally at a constant velocity.
It's easy to make this, as it corresponds likely with the coordinate axis.
Projectile.Velocity = Vector3.new(ShotVelocity, 0, 0);
Now let's say you wanted to rotate the object upwards so that it would shoot projectiles out at the same velocity but at a different angle. Let's say it's 15 degrees higher than the horizontal
Projectile.Velocity = Vector3.new(ShotVelocity*math.cos(math.rad(15)), math.abs(Shot.Velocity*math.sin(math.rad(15)),0))
Given this general relationship, how would you model a brick that shoots objects out at a relative direction it is facing using a consistent velocity? By relative direction, I specify using the part's Rotation Property.
As for 2 dimensional vectors, it seems like you already know how to do that. But 3 dimensional vectors are really complicated, so you probably don't want to do that manually. Just use some sort of unit vector from a part's CFrame, and multiply by the desired velocity.
Here's a cannon as an example.
local angle=60 --degrees local speed=100 local cannon = Instance.new('Part') cannon.Name='Cannon' cannon.Anchored=true cannon.Size=Vector3.new(7, 1, 2) cannon.CFrame=CFrame.new(0,5,-10)*CFrame.Angles(0,0,math.rad(angle)) cannon.Parent=workspace local ball = Instance.new('Part') ball.Name='Ball' ball.Shape=Enum.PartType.Ball ball.Size=Vector3.new(2, 2, 2) ball.Parent=game.ServerStorage while wait(3) do local b = ball:Clone() local p = cannon.CFrame.p local dir = (cannon.CFrame*CFrame.Angles(0,0,math.rad(-90))).upVector local target = p + dir*500 b.CFrame=CFrame.new(p+dir*(cannon.Size.X/2), target) b.Velocity=dir*speed b.Parent=workspace b.Touched:connect(function(hit) if hit~=cannon and hit.CanCollide then Instance.new('Explosion',workspace).Position=b.Position b:Destroy() end end) end