Jump to content

Collision types


Alienhead
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :(

Link to comment
Share on other sites

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. :(

Link to comment
Share on other sites

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.

 

  • Upvote 1
Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

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.

 Share

×
×
  • Create New...