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 » Scripting Helpers
Home Search
 

Re: Lock first person with a vehicle seat?

Previous Thread :: Next Thread 
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 12:53 PM
I just found out that the first person lock only works with the normal camera, and on a Vehicle seat, the lock doesn't work. Is there a way to fix this?
Report Abuse
Voidition is not online. Voidition
Joined: 14 Jul 2012
Total Posts: 1849
28 Mar 2014 12:54 PM
[ Content Deleted ]
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 02:04 PM
But all of my vehicles are based around vehicle seats, without it, none of the interior would work. So, I just want to lock first person when you sit in a vehicle seat.
Report Abuse
Voidition is not online. Voidition
Joined: 14 Jul 2012
Total Posts: 1849
28 Mar 2014 02:21 PM
[ Content Deleted ]
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 02:38 PM
Unfortunately, I have no idea how to do any of that, and just want to have first person locked when sitting on a vehicle seat. I really don't want to change the way my whole game works.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
28 Mar 2014 02:42 PM
I'll make a model for you because I'm nice :)
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 02:57 PM
For the custom vehicle seat, or the first person lock?
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 03:08 PM
Put this in the seat



script.Parent.Touched:connect(function(h)
plr = game.Players:FindFirstChild(h.Parent.Name)
if plr then
plr.CameraType = "LockFirstPerson" --Or is it CameraMode... I am not sure...
end
end)
script.Parent.TouchedEnded:connect(function(h)
plr = game.Players:FindFirstChild(h.Parent.Name)
if plr then
plr.CameraType = "Classic" --Again, could be CameraMode
end
end)
--If Touched/TouchEnded works on seats that will work...
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 03:14 PM
Yes sorry, it's CameraMode.


Put this in the seat



script.Parent.Touched:connect(function(h)
plr = game.Players:FindFirstChild(h.Parent.Name)
if plr then
plr.CameraMode = "LockFirstPerson"
end
end)
script.Parent.TouchedEnded:connect(function(h)
plr = game.Players:FindFirstChild(h.Parent.Name)
if plr then
plr.CameraMode = "Classic"
end
end)
--If Touched/TouchEnded works on seats that will work...
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 03:25 PM
I have already got a script that locks first person, and, as the original post stated, the vehicle seat camera is completely different to the normal camera, and so LockFirstPerson doesn't work with it.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 03:42 PM
It's a property shouldn't work?
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 04:28 PM
Vehicle seats completely change the way the camera works. The CameraMode property actually has no effect once you sit on one.

Actually, you know what, I'll try to figure something out myself.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Mar 2014 04:32 PM
Touched = false
script.Parent.Touched:connect(function(h)
P = game.Players:findFirstChild(h.Parent.Name)
if P and not Touched then
P.CameraMode = "Classic"
wait(0.3)
P.CameraMode = "LockFirstPerson"
end
end

script.Parent.TouchEnded:connect(function(h)
P = game.Players:findFirstChild(h.Parent.Name)
if P and Touched then
Touched = false
P.CameraMode = "Classic"
end
end)
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 06:31 PM
The CameraMode property doesn't work with vehicle seats.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 07:11 PM
I'll have to look into that tom. If I figure it out, I'll let you know.
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
28 Mar 2014 07:16 PM
script.Parent.Seated:connect(function(h)
plr = game.Players:FindFirstChild(h.Parent.Name)
if plr then
plr.CameraMode = "LockFirstPerson"
end
end)

script.Parent.TouchedEnded:connect(function(g)
kk = game.Players:FindFirstChild(g.Parent.Name)
if kk then
kk.CameraMode = "Classic"
end
end)
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
28 Mar 2014 07:16 PM
Im surprised no one knew about .Seated
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
28 Mar 2014 08:12 PM
Still won't work, because it uses the CameraMode property, which vehicle seats disable.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Mar 2014 10:01 PM
vehicle seats reset the cameraMode
it can be changed if u wait() I think
Report Abuse
SuperSamioWorld is not online. SuperSamioWorld
Joined: 28 Sep 2008
Total Posts: 20
29 Mar 2014 06:04 AM
I've already got a first person lock enabled. When I get into the seat, it stops working, and when I get out of the seat, it works again.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 11:24 AM
that's because roblox changes the cameraMode ancd cameraSubject when .Seated...

in which case,you can have an event that waits about 0.5 seconds,changes the camerasubject to the player,and sets FPS back on..
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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