Hi I am trying to create a wall that will deflect objects using BodyVelocity and I think reversing the velocity of the object should do the trick, what I don't understand is the connection between Vector3 and BodyVelocity. I checked the wiki but it didn't really help me
A vector is a representation of a distance (called magnitude) in a particular direction.
"Vector3" is the name that ROBLOX gives to its implementation of vectors that work in 3-dimensional space. That means they function as positions or directions in the game world.
Vectors act a lot like numbers. You can add them together. You can scale them bigger or smaller using multiplication or division.
As a result, they also function as velocity or displacement -- since velocity is a rate of change in position.
The BodyVelocity object has a Vector3
velocity
property which is "the desired velocity of the part."
To make a Vector3 with particular values, use the 3-argument constructor Vector3.new(x, y, z)
where x
y
and z
are numbers.