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: How would I make something rotate around a fixed axis?

Previous Thread :: Next Thread 
crossbar is online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
24 Nov 2017 12:42 PM
For instance, in my FPS script, I have everything working fine but there's one problem, which is that when I rotate the shoulder with an offset from the head of 1 for the y-value.

It looks like this when it's rotating:

<-------^-------->, basically it is rotating with 1 stud as its radius around the fixed point which makes my arm look ballistic and like it's got an air gap in between the shoulder and the arm.

I just want the shoulder to rotate like it would on a normal human without having to deal with such huge gaps because of the offset I welded the arms to the head.

If anyone can help with me with this, it would be really greatly appreciated. Thanks!
Report Abuse
crossbar is online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
24 Nov 2017 12:50 PM
Bump
Report Abuse
crossbar is online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
24 Nov 2017 12:58 PM
Please help me with this, I may even donate generously to someone who can help me solve this.
Report Abuse
crossbar is online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
24 Nov 2017 01:07 PM
plz halp (last bump)
Report Abuse
Quasiduck is not online. Quasiduck
Joined: 28 Sep 2008
Total Posts: 2437
24 Nov 2017 03:49 PM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=227256120
Report Abuse
crossbar is online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
24 Nov 2017 09:18 PM
Thanks Quasi, but would this work with welds as well?
Report Abuse
Quasiduck is not online. Quasiduck
Joined: 28 Sep 2008
Total Posts: 2437
25 Nov 2017 06:07 AM
Yes.

Though the axis will be in the object space of Part0 I believe.

You can switch between object space and world space using toWorldSpace and toObjectSpace.
Report Abuse
crossbar is online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
25 Nov 2017 01:09 PM
Sorry, but I did this:

rightArmWeld.C0 = rotateAboutAxis(rightArmWeld.C0:toObjectSpace(rightArmWeld.Part0.CFrame), rightArmWeld.Part0.Position, rightArmWeld.Part0.CFrame.lookVector, math.rad(i))

With the right arm welded to the head, and the arm just started rotating like crazy around the head. I know i'm probably doing something wrong, so could you tell me what exactly I need to put into the parameters of your function to work?

Thank you!
Report Abuse
Latine_Lemonade is not online. Latine_Lemonade
Joined: 10 Apr 2017
Total Posts: 143
25 Nov 2017 01:31 PM
math.pi is very useful in this situation.
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