Jump to content

Collision type property


Rick
 Share

Recommended Posts

I need a collision to be fired, but not cause a physical effect of stopping things from moving through it. This needs to happen for both characters and any other shapes. I couldn't seem to get any of the pre-defined collision types to do this. Either they fire with character but not other shapes, or they fire with both but physically stop the object from going through them.

 

I see there is a SetCollisionType(), but it doesn't seem to be like in LE2 where I can determine if it should have a physical effect or not. There must be a way to do this right?

 

http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetcollisiontype-r35

Link to comment
Share on other sites

enum

{

 

kCollisionProjectile = 6,

kCollisionEnemyAI = 7,

kCollisionCorpse = 8

};

 

PhysicsDriver::GetCurrent()->SetCollisionResponse(kCollisionProjectile, Collision::Scene, 1);

PhysicsDriver::GetCurrent()->SetCollisionResponse(kCollisionProjectile, Collision::Prop, 1);

PhysicsDriver::GetCurrent()->SetCollisionResponse(kCollisionProjectile, kCollisionEnemyAI, 1);

PhysicsDriver::GetCurrent()->SetCollisionResponse(kCollisionProjectile, Collision::Trigger, 0);

PhysicsDriver::GetCurrent()->SetCollisionResponse(kCollisionProjectile, Collision::Character, 0);

PhysicsDriver::GetCurrent()->SetCollisionResponse(kCollisionProjectile, kCollisionProjectile, 0);

 

done =)

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
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...