Essentially I have a system I’m working on.
In this system there’s a part that rises, think lava/water/etc.
This part is rising slowly through a control module not related to the damage module.
The part is being spawned and has CanCollide off, but CanTouch on, and it is Anchored.
I’ve run into the same problem no matter what with normal hit detections.
Basically, the part is constantly getting taller (Y axis) and having to be moved up half of the growth to keep it growing upward/rising.
During that time, when it’s growing or moving, it disrupts touching, raycast, and even when I try to use position checks, making it very hard to get consistent hit detection. This makes the damage very unstable as I’ve noticed often the hit detection misses that it is there.
I tried to get clever and I spawned a vector3 value inside the part for size and position and I bound synced it with heartbeat or a variable timing (been playing with both) making it constantly update the position in those vector3 values, and I had that script omit updating any time the values come back nil, this way the value is constantly correct.
This seems like a waste resource-wise and I can’t use it with anything but region3 checking for overlap which gets to be a pain accurately detecting when it touches the player at all. Like I have to make a hitbox, update it, then try to check that hitbox for overlap with the parts vector3 values.
So my question is, does anyone know a solid, efficient, and reliable way, to detect a hit/touch/raycast/etc. between anything (I need to detect player hits and other object hits) with a constantly moving/growing part that has Collisions off and is not moving with physics?
Because of the speed at which the part is rising (a small amount often) sometimes it’s failing up to 80% of my hit checks regardless of the method, regardless of whether the check is run from the part’s perspective or the other part’s perspective.
It has to damage objects as well as players and I feel like I’m totally missing something obvious. I’m pretty sleep-deprived right now, so I figured it was time to get some advice here.