Quantcast
Channel: Latest Questions by Wrymnn
Viewing all articles
Browse latest Browse all 131

Cannot reference object itself

$
0
0
This is kinda strange thing, or I just forget something. I spawn object B from object A. And I make object A parent of object B right after its Instantiation. - Now the problem is, when I try to access object B via OnMouseEnter (yes object has collider) and lets say I print its name when I mouse hover over object B, it prints the name of object A. Why? - It breaks entire mechanics because I need to highlight object B when I mouse over it, I need to show GUI when I click on it etc. But this is really strange bug void OnMouseEnter() { print(this.gameObject.name); }

Viewing all articles
Browse latest Browse all 131

Trending Articles