I’m working on a game that features a large number of custom models, including creatures like SCPs, animals, and other unique entities. Each model has its own setup, and I want to implement keybind-triggered attacks (like biting) that deal damage.
Here’s what I’m currently trying to solve:
Damage Detection
I’ve been experimenting with using raycasting from the model’s HumanoidRootPart
to detect hits, but due to differences in model heights and structures, it hasn’t been very reliable. I’ve heard about using hitboxes instead, but I’m unsure how to set them up efficiently across all my models. How can I create and manage hitboxes that account for these height differences and ensure consistent damage detection?
Welding and Anchoring Hitboxes
I understand that hitboxes need to be welded to the model to move with it, especially during animations or when interacting with physics. However, I’m a bit confused about how welding interacts with anchored parts. If a part is anchored, does it affect the hitbox or the model’s ability to move? How should I handle the welding of hitboxes to ensure they work correctly without messing up the model’s movement or animations?
Ability Management
I’m also interested in learning how to effectively script abilities for these models, like triggering a bite or slice attack with a key press. How should I structure the code to manage cooldowns, detect hits, and apply damage efficiently? If anyone has tips or examples of how to manage abilities, especially with hitboxes or similar setups, that would be really helpful!
Summary:
- How can I efficiently set up hitboxes for reliable damage detection across different model heights and structures?
- What’s the best way to handle welding and anchoring for these hitboxes to ensure they follow the model correctly?
- How should I manage and script abilities (like attacks) for these models, considering cooldowns and hit detection?
I’d appreciate any advice, scripts, or best practices you can share. Thanks in advance for your help!