Look, I don’t know if you think providing solutions and giving insight to people on the devforum is enforced, but it’s not if you don’t have a answer you can just move on, it’s really not that important, plus feels like it’s this situation is getting heated.
No we dont.
Your post description says that
Is there a way to automatically add transparency parts in an ignore list
If anyone would read this they’d assume that you want to ignore transparent parts while raycasting.
then you say
Look, i already have a solution, but I don’t want to use said method, I want to know if there is a way to cast one , and one ray only and ignore if there is a transparent part in in front of said ray
but the method provided by @Razor_IB casts one and only one ray and that should be the suitable solution for this problem.
Another thing one reading your post can make out is that you want the ray to ignore one specific transparent part and not all transparent parts in which case you can simply do this
Params.FilterDescendantsInstances = {IgnoredPart}
TL;DR you seem to contradict your goal in several of your replies
Did you read all of my threads?
Because I clearly state that I want to cast one ray, and if that one ray hits a part that is transparent, is there a way to make the ray continue (go through) said part without needing to cast an additional ray.
Yes, I told you how to do that in my last reply. @Razor_IB’s solution is what you should be using with a few tweaks. All his solution does is make use of the IgnoreDescendantsList property of RaycastParams and adds all transparent parts to that list (which means there will only be one ray cast and that ray will go through and ignore all transparent parts.)
But I stated that I don’t want to add descendants that are transparent to the filter.
unless theres parts within that transparent part (as children) then the descendants of that model will not be ignored
Here’s what I mean
in this case the non transparent part
will NOT be ignored by the ray
BUT
in this case the non transparent part
WILL be ignored by the ray (as its a descendant of the part)
There aren’t transparent children in the object, there is one part over shadowing another part, is there a way to for the ray to go through the part without needing to cast another ray entirely?
if the part has no descendants then the IgnoreDescendantsList
solution is the way to go, it does NOT cast multiple rays!
There is a part in front of another part, not in models, descendants, children there are two parts in workspace one is over shadowing another, is there a way to cast one ray that goes through that part?
See, did you read my reply at the top, it’s just in front not inside a model, etc
Please read it carefully.
Don’t know if anyone has mentioned this yet, but you can set the transparent parts to a different collision group.
Then set the ray to a separate collision group by using RaycastParams.CollisionGroup
, and this group has collisions turned off with the transparent parts collision group.
you’re not understanding what Im trying to say. If you set the IgnoreDescendantsList
to that part (or all transparent ones, your choice)
then the ray will go THROUGH that part by default, it will ignore it, you have to do nothing else than assigning IgnoreDescendantsList
appropriately.
No matter if its inside the model or outside it will be ignored and the ray will go through.
Thank you, see they get what I’m saying.
So set the transparent part collision group to something different I.e 2, and set the rays collision group to something higher?
Yes, I know that, but when it’s added to the filter i need to cast another ray, because the first ray has already hit something. That’s how you got the transparent object, in the first place.
no you dont, the ray will NOT hit that part at all (if you set the filter BEFORE casting the ray which is how it should be done in all cases)…
the ray will continue moving as if that part never existed
It doesn’t matter what order the collision grouping is, just simply uncheck the box where the racyast and transparent part collision groups meets.
In this image, both “raycast” and “thin” will collide with the default collision group, but won’t collide with each other
I can’t set it before because, theoretically the part could still be there or it be gone. Do you feel me?!
ray casts are instantaneous, the chance that the part will be deleted/created while the ray is being cast is negligible so you should be fine. The collision group method also works
Thanks, this is exactly what I’ve been looking for. And it was a more comprehensible solution that I thought.
THANK YOU
Not deleted while the ray is casting, I mean if the part doesn’t exist. There is nothing to add to the filter, but it’s fine, I’ve got the solution provided by @amadeupworld2
The new easy way to make the RayCast go through an invisible part is by disabling the “CanQuery” property of the part.