|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|