how i can enable, collision for 2 object specific, without afecting the other objects?
Hello,
For collision in specific 2 object you can add layer or tag.
- if(col.gameObject.tag ==“LampTrigger”)
- {
- // do something
- }
- You can also check tha name of the gameobject like this → col.gameObject.name == “Something”
Thanks
I put this script over the game object? This script is complete?
I’m not an expert but I think you should replace “//do something” with what you want it to do
1 Like
Hi,
You have to write this code under oncollisioneneter or in ontriggerenter.That is depending upon the condition.
You have to set tag on the specific gameobject you want.
And instead of “//do someting” you can do your code .
Thanks
1 Like