#unity #devlog #blender
SCRIPT \/ \/ \/
paypal me paypal.me/kimzastory ty!
Play my game :D: https://kimza.itch.io/immigrant
https://kimza.itch.io/impact and https://kimza.itch.io/impactweb
HOW TO ENABLE AND DISABLE GAMEOBJECT IN UNITY
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnabledOrDisabled : MonoBehaviour
{
public GameObject pic;
public void Trigger(){
if(pic.activeInHierarchy == false){
pic.SetActive(true);
}
else{
pic.SetActive(false);
}
}
}
(dont copy this)
--------------------------
Q: how to code works?
A: so we need to define the gameobject we wanna enable/disable by creating a variable
then create a void NEEDS TO BE PUBLIC so that will hold the code
dont use void update because we will be putting it to the button
so if the gameobject we defined on the variable was not active in the hierarchy we wanna setactive to true so the the gamobject object will be active
but if the gameobject is active in the hierarchy we wanna setactive to false
unity,unity3d,game development,unity game dev,unity game devlog,unity tutorial,how to,unity how to,HOW TO ENABLE AND DISABLE GAMEOBJECT IN 30 SEC (UNITY) *EASY*,unity game,devlog,how to unity,how to setactive,how to enable and disable gameobject,how to enable and disable gameobject in unity,kimza,kimza unity,unity kimza,unity devlog,unreal engine,unreal engine 5,blender,Unity,dani,jonas tryoller,will you snail,jonas tryoller will you snail
Watch video HOW TO ENABLE AND DISABLE GAMEOBJECT IN 30 SEC (UNITY) *EASY* online without registration, duration hours minute second in high quality. This video was added by user Kimza 14 March 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 41,951 once and liked it 405 people.