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 » Scripting Helpers
Home Search
 

Re: Vector3.FromAxis expects Enum.Axis input

Previous Thread :: Next Thread 
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
21 Jan 2014 09:50 PM
First of all, why does it have to be an Enum.Axis?
Secondly, how to I make the Enum.Axis equal the axis (or axes[plural]) of a brick?

-I need to get a brick to stay locked to a movable and rotatable axis, also called an origin.
Report Abuse
TheLuaWeaver is not online. TheLuaWeaver
Joined: 09 Feb 2010
Total Posts: 1504
21 Jan 2014 09:56 PM
Was FromAxis added recently (to the wiki or in general), or did I just skip over it while reading docs?

Anyways, it has to be an axis enum because there are only certain axes, and it doesn't make sense to not have it be an enum. You can't get the relative axis of a part using this, but you can using CFrames.

~LuaWeaver; Programmer, gamer, developer.
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
21 Jan 2014 10:43 PM
Okay, but say I have one anchored brick and one not anchored, and I want the one that isn't anchored to stay fixed to the Y axis of the anchored brick. How would I go about doing that? I have found how to get them to have the exact same rotation, all I need now is to get the one that isn't anchored to move to a spherical location around the anchored part depending on its angle.

Here's the code I came up with:

local A = script.Parent.Align
local T = script.Parent.Target

A.CFrame=T.CFrame*CFrame.fromAxisAngle(T.CFrame.lookVector,2*math.pi)
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
21 Jan 2014 10:59 PM
Nevermind that code, it does the same as A.CFrame=T.CFrame
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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