|
| 18 Nov 2016 10:51 AM |
dear personalityless nerds,
When I have my menu of the planets in my game, The user/player is supposed to be able to click on the planets. When they do click on the planets, the camera is supposed to move and lock onto the clicked planet. The game loads in on the starting planet, "Earth", but in the game the camera doesn't lock onto the other planets when clicked. Instead it stops following Earth and stops where-ever it is.
May you brainiacs help me?
I'm not gonna bother giving you the script to fix it because it will give you a headache of deoptimization OCD because im a nub.
My script is based around:
while wait() do -- Orbit loop camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(0, angle, 0) --Rotate by the angle * CFrame.new(0, 0, 8) --Move the camera backwards 8 studs angle = angle + math.rad(1) end end)
Mind my edgy username because I just realized i'm writing on my phantom forces account. I have this thread tracked on my main "CharcoalBurns". Any PM's, follow and write me on that account. kthx |
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 18 Nov 2016 10:53 AM |
Instead of doing while wait() use the RunService
Do something like
run = game:GetService("RunService")
run.Heartbeat:Connect(function() camera.CoordinateFrame = CFrame.new(target.Position) * . . end)
When clicking on another planet, are you change the target? |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2016 10:56 AM |
Yes when I click another planet it changes the camera target but the camera stops whereever it is instead.
|
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 18 Nov 2016 10:57 AM |
Have you tried using RunService?
Anyways I have a script like this but I'm not home right now so I can't exactly help you 100%. |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2016 10:59 AM |
No I haven't...
I will in a minute after I clear things up..
...
get home faster plz |
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 18 Nov 2016 11:00 AM |
| I'm at school lmao won't get home until 1:00. It's 9 here. |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2016 11:03 AM |
| if u do homeschool u can do what-ever the # ### want as long as you keep up with pace and get good grades. You're own pace if you wan't I recommend Florida virtual schools free if inside of florida == true free if outside of florida == false Thx for trying to help! |
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 18 Nov 2016 11:04 AM |
| No problem. If you still didn't find your answer by the time I get home, I'll try and help. |
|
|
| Report Abuse |
|
|
| |
|