Event.on_entity_collision
Posted: Sun Jan 14, 2018 10:25 pm
on_entity_collision
Called when a car or train collides with another entity
contains:
entity_a: LuaEntity the entity instigating the collision (a vehicle)
entity_b: LuaEntity the entity being hit (can be a vehicle or other sort of entity) or nil
tile_b: LuaTile the tile being hit or nil
Either entity_b or tile_b should be populated.
In a collision between two vehicles entity_a or entity_b could be either vehicle, entity_a is probably whichever one gets processed first.
Called when a car or train collides with another entity
contains:
entity_a: LuaEntity the entity instigating the collision (a vehicle)
entity_b: LuaEntity the entity being hit (can be a vehicle or other sort of entity) or nil
tile_b: LuaTile the tile being hit or nil
Either entity_b or tile_b should be populated.
In a collision between two vehicles entity_a or entity_b could be either vehicle, entity_a is probably whichever one gets processed first.