Ok, so this was originally going to be a help post asking about a way to update the hitboxes, but I decided to do some digging in how the
hits() function works
So, first of all, the “hits” function contains 3 functions for the 3 modes:
rectangleHits(), circleHits(), and convexHits()
I haven’t gone through the circle function, and the convex function is too long for me to explain (or comprehend right now, cuz i dont have enough time), but the rectangle function uses the absoluteBounds property for both objects (there’s actually a TODO comment to change this to a method that doesn’t rely on paper.js rectangles)
After a small test, I have confirmed that absoluteBounds does not update until the end of a frame, which does make sense.
Although I haven’t done too much testing with it, I’m currently seeing if just moving the absolute bounds with the clip fixes this, (however, it uses the top-left xy instead of origin x and origin y)
I haven’t actually tested this method yet, and I’ll give an update on if it works or not later
Original help post
This text will be hidden
What Wick Editor Version are you using?
Describe the Problem
Basically, I’m having problems because hitboxes only update at the start of the frame.
This makes any form of collision difficult since collision is only registered after all of my code, so if a clip moves then checks its hitbox, it checks based on the previous frame, instead of its new position.
Basically, I want to know if there’s some wick function that updates the hitboxes.