Jump to content

Collision types other than Character ignore subsequent triggers.


Recommended Posts

Collisions in Leadwerks EXCEPT for character collisions will tend to ignore collision triggers unless swept collision is turned on. If you turn on swept collision, and programatically move the object, all collision types except for character will detect the first trigger, move to the second, fall and then detect that it is in a trigger.

 

Sadly I don't have a map ready to test on.

 

Video

 

Link to comment
Share on other sites

Make a new collision response rule in Main.lua.

 

-- Props can activate triggers.
Collision:SetResponse(Collision.Prop, Collision.Trigger, Collision.Trigger)

 

You might also want a new collision for objects that are picked up. Vectronic is a working example of this.

 

Collision.PickedUpProp = 12
-- Picked up objects can still collide with triggers, but never characters.
Collision:SetResponse(Collision.PickedUpProp, Collision.Character, Collision.None)
Collision:SetResponse(Collision.PickedUpProp, Collision.Scene, Collision.Collide)
Collision:SetResponse(Collision.PickedUpProp, Collision.Prop, Collision.Collide)
Collision:SetResponse(Collision.PickedUpProp, Collision.Trigger, Collision.Trigger)
Collision:SetResponse(Collision.PickedUpProp, Collision.PickedUpProp, Collision.None)

  • Upvote 1

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...