Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need help understanding the connection between Vector3 and BodyVelocity? [Answered]

Asked by 10 years ago

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

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

Ad

Answer this question