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 |
|
|
|
| 19 Jul 2015 10:34 PM |
| Plane:SetPrimaryPartCFrame(CFrame.new(CurrentVector3Pos,Vector3ToLookAt)) -- Must define primarypart |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 02 Feb 2012 |
| Total Posts: 39 |
|
| |
|
Vebel
|
  |
| Joined: 02 Feb 2012 |
| Total Posts: 39 |
|
| |
|
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 |
|
|