Andy90 Posted October 1, 2023 Share Posted October 1, 2023 Hello I would like to inquire if it's possible to use an Lua function to determine if one entity collides with another. My objective is to verify whether the player remains within a trigger area. At present, I accomplish this by setting a boolean variable to true in the event of a collision with the player using Script:Collision. Then, in Script:UpdatePhysics(), I repeatedly reset this variable to false. Quote Link to comment Share on other sites More sharing options...
Alienhead Posted October 3, 2023 Share Posted October 3, 2023 Check out AABB. https://www.leadwerks.com/learn?page=API-Reference_Object_Math_AABB_IntersectsAABB 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
reepblue Posted October 3, 2023 Share Posted October 3, 2023 If it's physics related, use the Collision function instead of UpdatePhysics Use the entity argument to filter what entity or type it needs to trigger your event. 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Andy90 Posted October 4, 2023 Author Share Posted October 4, 2023 Thanks for the anwesers. On 10/3/2023 at 2:59 AM, Alienhead said: Check out AABB. i will check this On 10/3/2023 at 3:17 AM, reepblue said: If it's physics related, use the Collision function instead of UpdatePhysics Use the entity argument to filter what entity or type it needs to trigger your event. yeah i set a boolean variable to true within the method and set it to false within UpdatePhysics. So at the moment its working fine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.