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: 2D Game Camera

Previous Thread :: Next Thread 
akashsuresh is not online. akashsuresh
Joined: 15 Mar 2014
Total Posts: 10
29 Nov 2015 08:07 AM
I am creating a 2D game and so, I am attaching my camera to the part that is created in this localscript file(the camera subject is being set in a different localscript). This localscript is located in the StarterGUI folder. However, when debugging, I realize that this block shows up, has the BodyPosition property inside of it, but DOES NOT move to the player's torso. Please Help.---



local LocalPlayer = game:GetService("Players").LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:wait()
local cam = Workspace:FindFirstChild("Camera")

local Orb = Instance.new("Part", Character)
Orb.Name = "Orb"
Orb.Shape = Enum.PartType.Block
Orb.CanCollide = false
Orb.BrickColor = BrickColor.new("Bright green")
Orb.Transparency = 0.5
Orb.Size = Vector3.new(2, 2, 2)
Orb.TopSurface = Enum.SurfaceType.Smooth
Orb.BottomSurface = Enum.SurfaceType.Smooth

cam.CameraType = "Attach"

local BodyPosition = Instance.new("BodyPosition", Orb)

while wait(0) do
BodyPosition.Position = Character.Head.CFrame:pointToWorldSpace(Vector3.new(0, 0, 0))
end

Report Abuse
akashsuresh is not online. akashsuresh
Joined: 15 Mar 2014
Total Posts: 10
29 Nov 2015 08:18 AM
Oh, by the way, here's the OUTRAGEOUS thing - it only works in STUDIO, not in PLAY MODE!
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
29 Nov 2015 08:32 AM
Why not changing the CoordinateFrame of the Camera instead of changing the CameraSubject? I know that'll work... But I don't know what's wrong with this one, good luck with this script!

~sycips~
Report Abuse
akashsuresh is not online. akashsuresh
Joined: 15 Mar 2014
Total Posts: 10
29 Nov 2015 09:13 AM
I'll try. Thanks!
Report Abuse
alphaboy299 is not online. alphaboy299
Joined: 15 Jun 2013
Total Posts: 1496
29 Nov 2015 09:16 AM
Oh wait,I have a wiki page about this tagged.Gimme a sec.
Report Abuse
akashsuresh is not online. akashsuresh
Joined: 15 Mar 2014
Total Posts: 10
29 Nov 2015 09:16 AM
If I C-Frame the camera to the player, won't that turn the camera whenever the player turns? I want the Camera to be in that position moving in a horizontal line following the player.
Report Abuse
alphaboy299 is not online. alphaboy299
Joined: 15 Jun 2013
Total Posts: 1496
29 Nov 2015 09:17 AM
Here you go-http://wiki.roblox.com/index.php?title=Movement_and_camera_controls
Report Abuse
akashsuresh is not online. akashsuresh
Joined: 15 Mar 2014
Total Posts: 10
29 Nov 2015 09:19 AM
Thank you SOOOO much! This is JUST what I've been looking for!
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