Collisions?

  • #1, z red363Monday, 05. June 2023, 09:35 hodinky A year ago
    Hello!

    Tell me, please, is there any way to dynamically track collisions if a character's sprite intersects with an object's or another character's sprite? Any trick, for example, to create a circle around the sprite of the object with a given radius, or to attach an action area to it?

    Considering that this object moves around the scene

    Thanks

    Fanoušek fóra

    101 Posts


  • #2, z afrlmeTuesday, 06. June 2023, 00:08 hodinky A year ago
    You can check if something is in a specific radius of something else. Here's a radius function I shared ages ago - it's for checking if mouse cursor is within a specific radius, but it can be edited for other things; however, I think I shared a radius script on the VS discord a little while back that covered additional things.

    There's also a function called isPointInsidePolygon, but I don't know how taxing it would be on the engine to loop that function - especially on something as complex as a character with multiple animation frames & dynamically generated interaction polygons. I'm also not sure if you can actually access the polygon table for characters.

    Imperátor

    7285 Posts