After finding that the projectiles in my game are kind of difficult to use in terms of hitting anything, i have decided to give area to them (my original method was to create an arc of Rays to follow its path for collision detection) I first attempted this by trying to make a Region3 and set its CFrame to where my ray would be. After finding that the CFrame property of a Region3 is readonly (it doesnt say it’s readonly on the API reference, i had to find this out from the output window ), i am now having to decide between two alternatives:
1: i can use instead a part who’s size and cframe would emulate that of the rays, and call its GetTouchingParts() method to get parts that are colliding. The problem with this is that this method usually only detects parts if their CanCollide property is set to true, and the part in which the method is called must either have CanCollide set to true (cant do that, my bullets would cause players to fly off the map) or must have something connected to the part’s Touched event (i could make an empty method, but this seems hacky) There is also the issue that the player’s hitbox also has CanCollide set to false, and must have it set this way for the player to move properly. It would be possible to set the projectile and the HitBox to a different CollisionGroup, and this would most likely run without any errors. (assuming the collisionGroup means what i think it means) This method of detecting the collision; however, would consume way more resources due to the instantiation of several parts when a single bullet is fired (there are lots of them in this game)
2: I could keep my raycasting method, and instead increase the size of the player’s hitbox. I do not know if this will have the effect that i was hoping for with the area method above ^^, but this would consume the least resources possible, which should probably be priority concern.
I do not know which i should choose, please help me ;-;
Any feedback is appreciated