Alienhead Posted March 22, 2022 Share Posted March 22, 2022 Is Physics collision the only system in LE? I could had sworn I read non-physics collision but maybe not.. Daily question :: How to rotate an entity without breaking the physics simulation ? Im rather to new to physics but understand the basics of it. Would it be "PhysicsSetRotation"? and do all force applies and rotations need to be made in func physicsUpdate only? and last but not least, im using time:getspeed() for my normal movement and rotations, does this apply to physics as well ? or is their a different tween for that or does LE handle it - itself ? Any examples of just a regular box moving and turning with physics? I was trying to download the Third Person Camera script example from the workshop, but all I get is Failed to Download workshop item. Thanks. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Thirsty Panther Posted March 23, 2022 Share Posted March 23, 2022 To rotate an object. To move an object. Tutorial on moving platforms. I was able to download the 3rd person script no problems. I loaded it from within Leadwerks itself. Go- Marketplace- Workshop - then search for the script. 1 Quote Link to comment Share on other sites More sharing options...
Alienhead Posted March 23, 2022 Author Share Posted March 23, 2022 I rebooted and signed back into steam and it downloaded properly. tyvm. 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted March 23, 2022 Author Share Posted March 23, 2022 That helped a lot, I was trying to use AddForce() to move the physics object, the standard pos/rotation commands fixed it, not sure why i thought that broke phys simulation but none the less. One last question then I'm going on break for a few days hehe, when I softly approach an object and bump it, the collision works fine. my character stops and can't pass. but if I go into it with more force ( not a lot just an small increase ) then I seem to pass right through the object. Any ideas? I was reading up on SetSweptCollisionMode but if didnt seem to help my cause. Ty. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Thirsty Panther Posted March 23, 2022 Share Posted March 23, 2022 Is the object you pass thru thin? In the past people had problems with player falling thru the terrain but I think that was fixed. Maybe post an example map so we can have a look at it. Enjoy your break. Quote Link to comment Share on other sites More sharing options...
Alienhead Posted March 23, 2022 Author Share Posted March 23, 2022 https://youtu.be/DPqfgtgPzH4 The shape - https://imgur.com/n2G7S5d Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Genebris Posted March 23, 2022 Share Posted March 23, 2022 Try using cylinder collider for a tree, mesh collider for this is impractical. Quote Link to comment Share on other sites More sharing options...
Alienhead Posted March 24, 2022 Author Share Posted March 24, 2022 4 hours ago, Thirsty Panther said: Is the object you pass thru thin? In the past people had problems with player falling thru the terrain but I think that was fixed. Maybe post an example map so we can have a look at it. Enjoy your break. Yes I get the occasional 'fall through the floor' also, on the same map as the video.. It's random though. Sometimes my player will be idle, I get to go grab a soda and come back and he's falling to the underworld Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted March 24, 2022 Author Share Posted March 24, 2022 1 hour ago, Genebris said: Try using cylinder collider for a tree, mesh collider for this is impractical. Yes Sir, I was just using that shape since the other I couldn't get to work, figured if that one didn't then I'd stop worrying with it. No shapes in the editor helped my problem. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Genebris Posted March 24, 2022 Share Posted March 24, 2022 First, I don't think Turn and Move are allowed for physics objects. It was PhysicsSetPosition before, but then Josh implemented something else: On 9/27/2018 at 6:31 AM, Josh said: If you are continually changing the position of an object each frame, it will break the physics simulation each time. PhysicsSetPosition() was an old command that has been left in for backwards compatiblity, but is removed from the documentation because a better method has been implemented. The kinematic joint will allow you to precisely control the orientation of an object with physics forces: https://www.leadwerks.com/learn?page=API-Reference_Object_Joint_Kinematic https://www.leadwerks.com/learn?page=API-Reference_Object_Joint_SetTargetPosition https://www.leadwerks.com/learn?page=API-Reference_Object_Joint_SetTargetRotation Also, do you use character controller? I think you should since this is your character. It will allow AI to navigate to you. With character physics mode you use this method: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_SetInput You can find how it's used in default FPS character example. 1 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted March 25, 2022 Share Posted March 25, 2022 Quote How to rotate an entity without breaking the physics simulation ? There is AddTorque() that adds rotating forces to an object with Mass: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_AddTorque But I think you are looking for the kinematic joint functions as Genebris said. I think your tree shape problem results of using a wrong method to move your character. I never had this problem while using the Physics movement rules in Leadwerks. 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.