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
 

CFraming Problems With Euler Angles

Previous Thread :: Next Thread 
ElBurrito is not online. ElBurrito
Joined: 19 Sep 2009
Total Posts: 24
20 Jan 2017 10:10 PM
So I'm working on new morph positions for one of my games, what I'm doing is using a gui that when clicked changes the position of bricks within a player's morph. For the most part everything is working fine, except one specific part doesn't want to rotate correctly.
Changing the rotation values of x or z cause the one part to move along the exact same axis, instead of the x and z axis separately.

Here's the basic script for what I'm doing to change the part's position.

function onClicked()

weld1 = script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Model.Part1.Weld
weld2 = script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Model.Part2.Weld

weld1.C1 = CFrame.new(0,-.01,.04) * CFrame.Angles(1.029,0,0)
weld2.C1 = CFrame.new(-.025,0,.025) * CFrame.Angles(1.9,3.15,0)

end
script.Parent.MouseButton1Down:connect(onClicked)

Everything works fine for rotating part 1, however the x and z values of part two cause it to rotate on the exact same axis in the exact same direction. I've been reading the wiki and browsing the forums for anything that might help but I have yet to figure out why this is happening or if there is a solution to this that doesn't involve using a whole different method. Anybody have a clue as to why both these two values cause the brick to rotate in the same direction?
Report Abuse
AbstractMath is not online. AbstractMath
Joined: 05 May 2012
Total Posts: 1331
20 Jan 2017 10:29 PM
I believe the problem you're experiencing is called "gimbal lock".
Report Abuse
ElBurrito is not online. ElBurrito
Joined: 19 Sep 2009
Total Posts: 24
20 Jan 2017 11:04 PM
Never heard that term before so I looked it up and yes, I am definitely experiencing a gimbal lock. So I would assume that the initial rotation of the brick before cframing may be the cause of the lock?

One thing I did before looking at your reply was to try changing the part into a union, which that did seem to fix the problem. Which from my experience the rotation of angled parts often changes when unioned. So I would guess the best way to go about "fixing" this problem is to either alter to parts position before cframing or just keep changing all three rotation values until the lock is undone? Unless anybody has a better solution.
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