tipforeveryone Posted February 21, 2016 Share Posted February 21, 2016 Hello, I want to create my own Player in Lua, here is my code for its body body = Model:Box() body:SetShape(Shape:Box()) body:SetMass(20) body:SetCollisionType(Collision.Character) body:SetPhysicsMode(Entity.CharacterPhysics) Then I create a Camera and SetParent(body), add some movement controls (AWDS) too. In debug mode, I use SetDebugPhysicsMode(true) to display physics Compare to Default FPSPlayer, its cylinder physic is so accurate when I move close to an object (Collision.Prop). My character body sometime goes through other objects and its cylinder physic is not accurate. When I release my control key (ex W key), if cylinder physic intersect with an object, my character body will be pushed back a long distance from that object. Can you show me how to make my character body be same as Default FPSPlayer's, to be so accurate Quote Link to comment Share on other sites More sharing options...
Brutile Posted February 22, 2016 Share Posted February 22, 2016 What are you using for movement? The default FPSPlayer script uses entity:SetInput(). If you are using entity:SetPosition() or similar, it may cause the issues described. 1 Quote Link to comment Share on other sites More sharing options...
tipforeveryone Posted February 22, 2016 Author Share Posted February 22, 2016 What are you using for movement? The default FPSPlayer script uses entity:SetInput(). If you are using entity:SetPosition() or similar, it may cause the issues described. Oh I am using entity:Move() if window:KeyDown(Key.W) then body:Move(0,0,0.1) end I will test SetInput() function tonight thanks for your suggestion 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.