DudeAwesome Posted January 17, 2014 Share Posted January 17, 2014 I rotated an entity (ground) with function Script:UpdateWorld() if App.window:KeyDown(Key.L) then rotationNow = self.entity:GetRotation() self.entity:SetRotation(rotationNow.x,rotationNow.y,rotationNow.z-1) System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z) end if App.window:KeyDown(Key.J) then rotationNow = self.entity:GetRotation() self.entity:SetRotation(rotationNow.x,rotationNow.y,rotationNow.z+1) System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z) end if App.window:KeyDown(Key.K) then rotationNow = self.entity:GetRotation() self.entity:SetRotation(rotationNow.x-1,rotationNow.y,rotationNow.z) System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z) end if App.window:KeyDown(Key.I) then rotationNow = self.entity:GetRotation() self.entity:SetRotation(rotationNow.x+1,rotationNow.y,rotationNow.z) System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z) end end before rotation https://www.dropbox.com/s/wobccysass1cxtc/Screenshot%202014-01-18%2000.37.51.png after rotation https://www.dropbox.com/s/t7p73t5x9tm969f/Screenshot%202014-01-18%2000.38.19.png when I have probs (like the sphere) on the ground they ignore the rotation and stay in the air until I touch them (with FPSplayer) I think I need some kind of UpdateShape() or UpdatePhysics() someone could tell me the right command that my props act like they should ? Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
shadmar Posted January 18, 2014 Share Posted January 18, 2014 entity:AddTorque(x,y,z) (force based) entity:Turn(x,y,z) (not force based) both are simpler than SetRotation() and SetPhysicsRotation() If you are making the ball roll on the gound using keys, I'd use AddTorque, since it's physics based. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
DudeAwesome Posted January 18, 2014 Author Share Posted January 18, 2014 no not the ball i will just Move the ground Like http://li.c-b.co/is/image/LandOfNod/3719411_MarblesGame_H08/%24web_zoom%24%26wid%3D550%26hei%3D550%26/1308310657/dont-lose-your-marbles-games.jpg Thx for Info Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 18, 2014 Share Posted January 18, 2014 Like shadmar mentioned, when you want to move objects with physics behavior, you need to use the PhysicsSetPosition and PhysicsSetRotation command. 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.