CollisionExit

Constructor:

CollisionExit()

Description

Triggered when the object ends a collision.

Parameters

Name Type Description
RWObject The object is hit

Examples

Create a part p1 and add an event of ending collision to it. The event will be triggered when the collision ends.

local function ExitEvent(res) -- define a method of ending collision
    print("The event is triggered when a collision ends>>>>>".." Who left the collision:" ..res.Name)
end
local p1 = RWObject.Create("Part") -- create a part
p1.Position = Vector3(0,10,0) -- assign a vector to the part position
p1.CollisionExit:Connect(ExitEvent) -- the method of ending collision

It is required to enable collision callback for collisions with non-human objects.
The following script can change the part color after the part hits other objects.

local temp = RWObject.Create("Part") -- create an instance temp of the part
temp.Position = Vector3.New(0,5,0)
temp.IsCollisionCallBack = true
temp.Parent = WorkSpace
temp.CollisionExit:Connect(function(hit)
    temp.Color = Vector3.New(255,0,0) -- the part turns red after the collision ends
end)