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
 

Restricting the camera?

Previous Thread :: Next Thread 
Revisional is not online. Revisional
Joined: 02 Aug 2014
Total Posts: 318
18 Mar 2017 05:16 PM
End goal:
- User can't look "up" to see what is above them
- User can't zoom out too far

Do not want to do:
- Restrict all free camera movement
- Create a "2D" view
- Force first-person

Reasoning:
- Creating a large adventure game with many areas
- Trying to create an "open-world" feel (Still utilizing nature and terrain, I don't want everything to be enclosed
- Would ruin the feel if the user zooms out and sees another area
- Would ruin the feel if the user looks up and sees an area above them

I don't know where to begin making this.
I have a lot of experience scripting and I've worked with the camera before, but this isn't something I know how to do.
Any advice/help/examples?
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
18 Mar 2017 05:17 PM
I don't like you, Revisional. I don't know why, and I don't know how.

But you will always know...

I'm not fond of you.


R$111,506 and climbing.
Report Abuse
Revisional is not online. Revisional
Joined: 02 Aug 2014
Total Posts: 318
18 Mar 2017 05:22 PM
:^(
Report Abuse
Revisional is not online. Revisional
Joined: 02 Aug 2014
Total Posts: 318
18 Mar 2017 05:30 PM
bump
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
18 Mar 2017 05:35 PM
in a renderstepped, check the camera's CFrame.lookVector and see if the y coordinate is greater than a certain amount. If so, reset it
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
18 Mar 2017 05:36 PM
By which I mean change the Cameras CFrame to look forward
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
18 Mar 2017 05:42 PM
Tested it try this:

use 0.7 instead

print("Hello world!")
local cam = workspace.CurrentCamera

game["Run Service"].RenderStepped:Connect(function()
print(cam.CFrame.lookVector.y)
if cam.CFrame.lookVector.y > 0.7 then
cam.CFrame = CFrame.new(cam.CFrame.p,Vector3.new(0,0,0))
end
end)
Report Abuse
Revisional is not online. Revisional
Joined: 02 Aug 2014
Total Posts: 318
18 Mar 2017 05:52 PM
That worked, thank you!
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
18 Mar 2017 05:54 PM
Np

as per the zoom distance set that by clicking of starterplayer and check the properties window and set the properties there.
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