|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 29 Nov 2015 09:16 AM |
| Oh wait,I have a wiki page about this tagged.Gimme a sec. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 29 Nov 2015 09:17 AM |
| Here you go-http://wiki.roblox.com/index.php?title=Movement_and_camera_controls |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2015 09:19 AM |
| Thank you SOOOO much! This is JUST what I've been looking for! |
|
|
| Report Abuse |
|
|