Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make Seated function that makes cursor moves freely in first person?

Asked by 6 years ago

To be exact, I need to detect if a player is seated the makes a function to cause cursor (CursorFreed) and after that, how to detect if player is not seated which cause to bring back locked first person again, similar to onTouch and TouchEnded. Some advice here?

1 answer

Log in to vote
0
Answered by 6 years ago

So, the easist way to do this is using a custom camera script, and using the humaniod's seated property

http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Seated http://wiki.roblox.com/index.php?title=Camera_manipulation

So this is what you do. Create a script that using the .changed event to detect when the seated property of a humanoid is changed. Then check if the seated property is true. If so copy a script from somewhere where it wont work (maybe player gui) and put it into the player.

The script will be a script that makes the camera stay in the players head. This will give a first person perspective and let the player move the cursor.

Now, when the .changed event is fired and humanoid.seated = false, then set the camera's camera type back to default so that the player can use roblox's default camera behavior

0
No, no.... Use a .Changed event on the Seat itself. Then, check if the property is "Occupant" and if it is, then that means that somebody has either gotten up or sat down. To check that just simply check if "Occupant" == nil and if it doesn't equal nil, then that means someone has just sat down... Otherwise, someone just got up... KingLoneCat 2642 — 6y
0
thanks NexoKami 12 — 6y
0
Oh whoops XD. I always forget that you dont use .Changed on the actual property, but what i'm trying to do is asumming this is all made in a local script User#17125 0 — 6y
Ad

Answer this question