Jump to content
Slastraf

Player aligns wrong with the camera

Recommended Posts

https://youtu.be/mcJiROYmByk

 

I made a Video for this, because it is hard to explain.

The player is not rotated right with the pivot that is at the same position, the green box ( camera )

is a child of the pivot.

 

function Script:UpdatePhysics()

local move = ((window:KeyDown(Key.D) and 1 or 0) - (window:KeyDown(Key.A) and 1 or 0))*4

local strafe = ((window:KeyDown(Key.W)and 1 or 0) - (window:KeyDown(Key.S) and 1 or 0))*4

if window:KeyDown(Key.W)then

self.entity:SetInput(self.pivot:GetRotation().y ,0,0)

end

end

Share this post


Link to post

Is it following the pivot's local rotation instead of global? GetRotation(true)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...