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: BodyGyro and walking on spheres

Previous Thread :: Next Thread 
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
19 May 2014 10:25 AM
I want my character to be able to walk on a sphere, and have the character model rotate accordingly, as if the sphere was a planet. I'm already using a BodyForce to simulate gravity, and a BodyGyro to rotate the character.
My question is; how would I make the rotation perpendicular to the sphere, as if my character was "standing" on it?

~The herp lerped a derp~
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
19 May 2014 10:26 AM
Is this possible e.o?
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
19 May 2014 10:33 AM
Of course it is. The only problem I see is with the camera and how it pans around (it can't rotate infinitely, has a fixed "up" and "down" position)

~The herp lerped a derp~
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
19 May 2014 10:35 AM
Idk how to do the camera thing but,


Try to create a fake brick as the camera object and pan it towards the Player's head, So if he walks upside down, The Camera oject is panned towards the head having a somewhat similar effect to camera rotation.
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
19 May 2014 10:50 AM
Anyway, that wasn't really what I was asking... Thanks though
Does anyone know how to make something face a certain position? No? D:

~The herp lerped a derp~
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
19 May 2014 11:28 AM
ask a guy called oysi if hes not busy, he made something like that

http://www.roblox.com/Galaxy-Wars-Under-construction-place?id=55703461

roblox probably broke it thought because of recent updates to the way the camera focuses on the player and stuff.

Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
19 May 2014 11:29 AM
Tell me about it... Camera focuses on humanoid instead of head and everything goes cray cray
I'll ask him though. Thanks.

~The herp lerped a derp~
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
19 May 2014 12:29 PM
I guess he's busy, I'm not getting any response.
Does anyone else know...? ._.

~The herp lerped a derp~
Report Abuse
robertjh12 is not online. robertjh12
Joined: 24 Feb 2008
Total Posts: 601
19 May 2014 12:58 PM
Run this to see its affect, then edit for your purpose.
game.Workspace:FindFirstChild(ownername).HumanoidRootPart:BreakJoints()
game.Workspace:FindFirstChild(ownername).HumanoidRootPart.CFrame = game.Workspace:FindFirstChild(ownername).HumanoidRootPart.CFrame * CFrame.Angles(0,0,5) --5 is just random number I picked. Adjust this angle for rotation around planet.

local W = Instance.new("Motor6D")
g = game.Workspace:FindFirstChild(ownername).HumanoidRootPart
p = game.Workspace:FindFirstChild(ownername).Torso
W.Part0 = g
W.Part1 = p
local CJ = CFrame.new(g.Position)
local C0 = g.CFrame:inverse()*CJ
local C1 = p.CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g
W.Name = "RootJoint"
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
20 May 2014 09:49 AM
Thanks robert, but that's not quite what I am asking. I have a method of rotating already. :P
What I want to know is how to find the angle itself, something which you described as... well... "Adjust this angle for rotation around planet."

Could anyone lead me in the right path? Please? :P

~The herp lerped a derp~
Report Abuse
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
20 May 2014 10:12 AM
Yeah, i think I know what you mean.


Ever seen gravity buttons? They rotate you upside down and the right way up when you touch different ones.

http://web.roblox.com/Anti-Reverse-Gravity-Buttons-item?id=3570149


From this, you could edit the script to hold a character along a sphere with the welds constantly adapting to each different angle. (This will be very complex and hard to do but it's possible)


Not to mention, you'll have to use BodyPosition on that sphere to hold a character onto it.

You can't change the camera angles much either so players just appear upside down on the bottom.


It's gonna involve some maths to, math.pi i recommend
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