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: Building a First Person Controlled Plane (suit)

Previous Thread :: Next Thread 
Vebel is not online. Vebel
Joined: 02 Feb 2012
Total Posts: 39
19 Jul 2015 10:32 PM
I have to explain more:
So basically, what I want to build is once I sit in my vehicleseat, my view turns into first person, and I know how to make the view first person. The problem is, I want to build a plane (actually, it's a suit), where you turn, and the plane/suit turns instantly with you. Normally, only the character's camera turns, and the plane doesn't turn.

What I want is that as soon I turn my head in first person, the plane turns also.

Please help
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
19 Jul 2015 10:34 PM
Plane:SetPrimaryPartCFrame(CFrame.new(CurrentVector3Pos,Vector3ToLookAt)) -- Must define primarypart
Report Abuse
Vebel is not online. Vebel
Joined: 02 Feb 2012
Total Posts: 39
19 Jul 2015 10:50 PM
Can you explain the script above me please? Thanks

1. What does it mean by PrimaryPart?
2. What is the Plane relating to? (Perhaps game.Workspace.Plane?)
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
19 Jul 2015 10:55 PM
PrimaryPart is the main part of the model. Look up how to set it.

Plane = [define it]

Plane:SetPrimaryPartCFrame()

^^that will move the primary part, therefore the model.

Plane:SetPrimaryPartCFrame(CFrame.new())

Make a new cframe..

Plane:SetPrimaryPartCFrame(CFrame.new(Plane:GetPrimaryPartCFrame().p))

get the vector3 pos of the plane..

Plane:SetPrimaryPartCFrame(CFrame.new(Plane:GetPrimaryPartCFrame().p,workspace.CurrentCamera.CoordinateFrame.p))

^^That would make it look at the CFrame/Vector3 of CurrentCam
Report Abuse
Vebel is not online. Vebel
Joined: 02 Feb 2012
Total Posts: 39
19 Jul 2015 11:12 PM
Thanks

I got up to here. For some reason, the script would not work. The script was intended to activate once my character touched my plane's vehicleseat (Just letting you know, my plane is called Nightmare)

-----------------------------------------------------------
Plane = game.Workspace.Nightmare

script.Parent = game.StarterGui

function onTouch(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
Plane:SetPrimaryPartCFrame(CFrame.new(Plane:GetPrimaryPartCFrame().p,game.Workspace.CurrentCamera.CoordinateFrame.p))
end

game.Plane.VehicleSeat.Touched:connect(onTouch)
---------------------------------------------------------------------

Am I doing something Wrong?
Report Abuse
Vebel is not online. Vebel
Joined: 02 Feb 2012
Total Posts: 39
19 Jul 2015 11:27 PM
Bump
Report Abuse
Vebel is not online. Vebel
Joined: 02 Feb 2012
Total Posts: 39
20 Jul 2015 07:54 AM
Bump 2
Report Abuse
ShungTzu is not online. ShungTzu
Joined: 14 Jun 2014
Total Posts: 959
20 Jul 2015 08:29 AM
cam=workspace.CurrentCamera

cam.Changed:connect(function()
Plane:SetPrimaryPartCFrame(cam.CoordinateFrame)
end)
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