Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Whatever
unity check if a gameobject has a component
ExocetKid
Programming language:
Whatever
2021-08-06 15:42:41
0
Q:
unity check if a gameobject has a component
Rithari
Code:
Whatever
2021-08-28 05:16:36
if(gameObjectToCheck.GetComponent<Rigidbody>() != null) { //do something }
3
Tags
unity
object
check
gameobject
component
game
Related
unity how to check how many gameobject of a tag exists
find child of gameobject unity
unity find gameobject
check if object has parent unity
New to Communities?
Join the community