Slastraf Posted October 10, 2018 Share Posted October 10, 2018 Hello I have a character model childed to a pivot with character physics, and I use SetInput() to move the character forward depending on how the rotation of the char model is. Their position is at the exact same place so it should actually work similar to the fps script, but it doesn't work so good. Take a look at the following video that demonstrates what is happening:I think its a small math problem, but here is the part of the script that controls it: self.entity:SetInput((self.character:GetRotation().y-90), playerMovement.z, playerMovement.x, jump , false, 1.0, 0.5, false, 50) -- note that the "-90" exists because the playermodel needs this offset to look forward if window:KeyDown(Key.Q) then self:addRotationOnY(-2) end if window:KeyDown(Key.E) then self:addRotationOnY(2) end --================================= function Script:addRotationOnY(params) local currRot = self.character:GetRotation() self.character:SetRotation(0, currRot.y + params, 0) end EDIT: this fixed it: local addRotation = 0 if window:KeyDown(Key.Q) then addRotation = -self.rotationSpeed end if window:KeyDown(Key.E) then addRotation = self.rotationSpeed end self.entity:SetInput((self.entity:GetRotation().y+addRotation), playerMovement.z, playerMovement.x, jump , false , 1.0, 0.5, true, 50) It is a workaround because one cant change an entities rotation if it uses SetInput with SetRotation() Quote Link to comment Share on other sites More sharing options...
Marcousik Posted October 11, 2018 Share Posted October 11, 2018 Did you try that "Character angle" -> 180 or 90 or ... instead of 0 , I can remember it did it for me in the past... 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.