of     1   

mazejaker
#36219551Saturday, October 30, 2010 12:39 PM GMT

I made this script so when you touch a characters torso (a character in my game) a camera will appear attached to them. It doesnt work, which to be honest im not suprised by. The output wont tell me whats wrong so i was hoping you guys could take a look? Im still a very weak scripter so theres probably LOADS wrong with it. function onTouched(hit) Cam = Instance.new("Camera") Cam.Parent = hit.Parent Cam.CameraType = "Attach" Cam.CameraSubject = game.Workspace.Terry.Torso end script.Parent.Touched:connect(onTouched)
lieutenant54321
#36219617Saturday, October 30, 2010 12:41 PM GMT

function onTouched(hit) Cam = Instance.new("Camera") Cam.Parent = game.Workspace.Terry.Torso Cam.CameraType = "Attach" Cam.CameraSubject = game.Workspace.Terry.Torso end script.Parent.Touched:connect(onTouched) Try that. Because hit.Parent would be your character ingame.
mazejaker
#36219618Saturday, October 30, 2010 12:41 PM GMT

Im also going to add a GUI box where you can talk to them but thats for later.
mazejaker
#36219651Saturday, October 30, 2010 12:42 PM GMT

Thanks, ill post back with the results :)
oysi93
#36219660Saturday, October 30, 2010 12:42 PM GMT

Cameras are local. Therefore they have to be placed in a local environment. Thus makin' it impossible to access the camera from a global script. What you do, is make a localscript and put it in your starterpack. You then connect that touched event to that brick from starterpack. Then you change the camera. =P Btw, you can access the camera using this: Workspace.CurrentCamera
mazejaker
#36219823Saturday, October 30, 2010 12:48 PM GMT

Thats very confusing :L
oysi93
#36219853Saturday, October 30, 2010 12:49 PM GMT

Indeed it is. =P But it cannot get less confusing. I suggest you learn a bit more about other stuff before you go on to local stuff (dealing with cameras local lighting etc)...
pauljkl
#36220562Saturday, October 30, 2010 1:08 PM GMT

Why not just move the camera to terry's torso?
mazejaker
#36220838Saturday, October 30, 2010 1:16 PM GMT

paul, do you mean change the CurrentCamera Parent to Terry's Torso? And then just change the Type to Attach?
mazejaker
#36260438Sunday, October 31, 2010 12:22 AM GMT

Ill have to give this a go tommorow lol.
walter232
#36270696Sunday, October 31, 2010 3:07 AM GMT

I don't like Cam's..

    of     1