Skip to content

Element events CollisionStart

Jérôme Leclercq edited this page Dec 8, 2020 · 3 revisions

Element event:CollisionStart

Description:

Called whenever this element collides with another one.

Returns:

false to prevent the collision, true to let the collision go on.

Return combination:

&&

Parameters:

  1. self: Triggered entity.
  2. other: Triggering entity.

Remarks:

EnableCollisionCallbacks must have been called on the entity for this event to trigger.

Example code:

entity:On("Init", function (self)
	self:EnableCollisionCallbacks(true)
end)

entity:On("CollisionStart", function (self, other)
	print("I collided with " .. tostring(other))
	return true
end)

Clone this wiki locally