Rockenite
|
  |
| Joined: 20 Dec 2011 |
| Total Posts: 1444 |
|
|
| 20 Aug 2017 05:45 AM |
How do I keep a vector direction pointing within 1 plane only?
Given some number y I want the vector to stay within a plane. Currently this doesn't work:
local directionBetweenTwoBalls = (part1.Position-part2.Position) newDirBetweenBalls =Vector3.new(directionBetweenTwoBalls.X,poolTable.WhiteBall.Position.Y, directionBetweenTwoBalls.Z)
|
|
|
| Report Abuse |
|
|
sonihi
|
  |
| Joined: 27 Jun 2009 |
| Total Posts: 3655 |
|
|
| 20 Aug 2017 07:57 AM |
From the last few posts I can tell you always use "vector direction" for just a vector. Vector direction always sounds like you're talking of a vector with length 1.
Anyway to keep them in a plane you need to define the plane first with 2 vectors. let's say Axis1 and Axis2
Then you just do VectorInPlane=(Vector:Dot(Axis1))*Axis1+(Vector:Dot(Axis2))*Axis2 |
|
|
| Report Abuse |
|
|
Rockenite
|
  |
| Joined: 20 Dec 2011 |
| Total Posts: 1444 |
|
|
| 20 Aug 2017 04:00 PM |
local directionBetweenTwoBalls = (part1.Position-part2.Position) newDirBetweenBalls =Vector3.new(directionBetweenTwoBalls.X,0, directionBetweenTwoBalls.Z)
No, it turns out all I needed to do was the above. Thanks anyway.
|
|
|
| Report Abuse |
|
|