so what’s the difference between these two? As far as i know they do the same don’t they? I never though about it to much but a friend who just got into coding asked me this and i had no idea what to tell him.
SetActive () is the right one. active is obsolete. Instead of active, there are now activeSelf and activeInHierarchy. You just need to check the documentation to find out what it is for or maybe have a look at a tutorial like this one:
http://unity3d.com/learn/tutorials/modules/beginner/scripting/activating-gameobjects
SetActive, is what you want active will work in most cases but it is there for legacy reasons not go break old scripts. Some new features of unity 4.6 like canvas dont work properly with active and require SetActive()
ohh thanks didn’t know that ;p
I’m changing the code as we speak but i ran into a problem how would i convert this
bool inCombat = sword_Hand.active || bow_Hand.active || rifle_Hand.active || pistol_Hand.active;
The yellow warnings in the console should make you realise this… ![]()
Also it mentions its depreciated in the docs as well as in the intellisense in vs has it flagged as such
Use activeSelf or activeInHierarchy depending on your needs.
yupp thats what i thought i will change that tommorrow thanks for the help