Raycast Help w/ CollectionService

So im pretty new to raycast and I tried using the raycastignorelist with collectionservice but I dont understand whats going wrong.

image

image

Can someone explain what im doing wrong.

Note that IgnoreTag is a table in itself.

Maybe do something hacky like this

IgnoreTag["Player"] = Character

then use IgnoreTag without the curly brackets

Last time I checked, :FindPartOnRayWithIgnoreList() doesn’t accept nested tables, IgnoreTag is a table containing objects, so those objects are discarded. Simply unpack the table. unpack(IgnoreTag).
Although this doesn’t relate to your error so I’m confused.

2 Likes

The IgnoreTag variable returns a table of all the instances that have been assigned with the tag. You’re inserting a table into a table, which will throw an error. Try inserting the character into the table, then use the table when drawing the ray in the workspace.

Yes, now I agree, unpack is the best choice here.

Ps; Still waiting for the next one of those challenges :sweat_smile:

1 Like