Geo Posted April 24, 2020 Share Posted April 24, 2020 Hypothetical scenario. Say that I've a table, maybe something like: gang_zone = {} gang_zone[1] = {} gang_zone[2] = {} gang_zone[3] = {} gang_zone[1] = createColCuboid(123, 456, 789, 1012) gang_zone[2] = createColCuboid(934, 534, 135, 1941) gang_zone[3] = createColCuboid(913, 851, 153, 3913) Is there a way a single onColShapeHit listens for a element hit on all these areas at the same time? Link to comment
KronoS Lettify Posted April 25, 2020 Share Posted April 25, 2020 Try to set ID to the element. And on event onColShapeHit set root element on 2° argument in addEventHandler, and inside function filter the colshape hitted by ID. Link to comment
Moderators IIYAMA Posted April 25, 2020 Moderators Share Posted April 25, 2020 14 hours ago, Geo said: Is there a way a single onColShapeHit listens for a element hit on all these areas at the same time? See this tutorial. Or attach the addEventHandler on to the resourceRoot. This will trigger the eventHandler only for elements created by the same resource. 1 Link to comment
Geo Posted April 27, 2020 Author Share Posted April 27, 2020 On 25/04/2020 at 09:14, IIYAMA said: See this tutorial. Or attach the addEventHandler on to the resourceRoot. This will trigger the eventHandler only for elements created by the same resource. Thank you so much man! 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now