Raycasting isnt very effective for large scale realtime physics applications atm due to the complexity of all the backend that roblox does, they are working on optimizing raycasts however I doubt they will ever be fast enough for something with large scale physics
Hereās a solution that works under all cases (99% sure) and that is very fast (~0.008ms)
boxtesting.rbxm (4.7 KB)
courtesy of @AxisAngle
Would it be possible to implement this into the SmartBone module to prevent it from clipping through the player?
Yes, from what I saw in the module the implementation would be running this after each normal bone update.
This is a real eye opener! I had a solution that was actually working for box collision, however it was very buggy in that sometimes the collision would fail and the bones would re-enter the box test. This however seems to have eliminated that problem!
Iām looking forward for the next update!
Will you be updating the module to have an optional collision-part table?
I really hope you do, because Iām not that good at scripting at a highly optimized level.
Some issue I ran into is they will start lagging if hairs collide with each other, Since I use Transformations and such, Is there a way to make Hair stop being Animated when its Transparent?
Would you mind sharing the hair physics one you made? Iād like to look into it and see how I can incorporate my own hairs and test performance on my end before trying.
Is this the same/similar method that I see in tank games like Steel Titans and Cursed Tank Simulator?
Iāve been trying to figure out how they managed to do the tracks and wobbly antennas lately, but I donāt know exactly what to look forā¦
But could someone at least tell me how they did the wobbly antennas?
This is actually pretty smart! I tested it a few months ago and I love how smooth it works, but Iām having a problem. I implemented the SmartBone in a ponytail of a morph, whenever an animation is played by the character it kinda breaks the whole animation, this only happens with centrain animations, what it could be?
do you have any footage of it?
Does anyone have any hairs that have bones in themā¦ I canāt find any.
Yes! The arms and many other parts are supposed to be moving but they are like frozen.
I also looked very deeply for the error and tried to see if it was any core of the animation or the script but any of those seem to be causing this bug, if I remove the ponytail from the morph it starts going normal and smooth.
What are you using to weld the hair to the head? If its a motor6d, I recommend switching to a normal weld. and make sure only the part that has the bones in it is set up for SmartBone
The hair itās actually not connected to the head, itās just a model called āHeadā and all the head parts are there including the ponytail. Itās like it haves 6 bones but only 5 of them have the SmartBone, the other one itās weighed to the top of the ponytail so the whole thing doesnāt move, so I donāt know what else it could be.
In that case, did you make sure the RootBone attribute is set only to the hair?
Will you be updating the module to have an optional collision-part table?
Yes its only set to the hair, here is a better preview of the problem.
As you can see when I remove the hair, the animation starts to go smoothly that itās how it should go, Iāve searched everywhere and tried for everything but I still canāt figure it out.
Is there a possible way to stop hair from moving if it is Fully Transparent?