y.velocity = Vector3.new(0, -10, 12)
The code above makes the block travel but I want it to travel in the direction I'm facing, How would you do that?
In order to move a block the direction you're facing, obviously you must have some way of accessing which direction you're facing. This is done by using lookVector.
lookVector is a property of CFrame that allows you to access which way an object is facing.
"The lookVector
of a CFrame is a unit vector pointing in the direction of the CFrame's forward direction (-z in object space) or front face." -BlueTaslem
workspace.Part.Velocity = workspace.Part.CFrame.lookVector * 100
This will make an unanchored and unattached Part move toward its front face. We multiply it by 100 just to add some speed.