generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Constrain a vector direction to a plane

Previous Thread :: Next Thread 
Rockenite is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image