Setting renderer.enabled to true does not render gameobject
I have a list of instantiated prefabs. A function is called that loops through them and for each gameobject that is not set to owner==1, its renderer is disabled. This part WORKS. The part that does...
View ArticleAccessing a Parent's PhotonID from a child's script
When I access my child object in question's renderer property, it affects all objects accessing the server that fall under the property of (isMine). When I update the child's renderer ALL client's...
View ArticleRequesting help with Time.time & Instantiate script.
Greetings So I want to instantiate an object after a certain time (4 seconds) and the code runs fine, no errors appear and I can execute the game but no object instantiates after the 4 seconds? Here's...
View ArticleCheck if a camera is looking at an invisible object
I know how to check if the renderer is visible, but I want to know if a camera is looking at an object WITHOUT a renderer enabled. I don't want an object to enable rendering when a camera is looking in...
View ArticleNo renderer.enabled=false on grouped GameObject
Hi everyone, if some of my Gameobjects are grouped in the hierarchy "GameObject.renderer.enabled = false;" is not working. I just want hide some objects if the mouse is over an object. Is there anybody...
View ArticleAccess renderer from transform
Hi guys, I have been trying to access the Renderer from a Transform that I have instantiated. The error is "Object reference not set to an instance of an object", and it appeared at the GridEnable and...
View ArticleHow to whrite in c# the code: onMouseEnter Hide mesh
Hi, I Am writing a code in c# here is what I have at the moment using UnityEngine; using System.Collections; public class MouseOver1 : MonoBehaviour { void OnMouseEnter(){ renderer.enabled = false; }...
View Articleplease need a littlebit of help with a ForceShield
Hey guys this script does not work propperly cn you help me? its attached to a sphere that simulates a force Shield. and my idea was to get the forseshield ony able to see when its been hit by my...
View ArticleNo 'Renderer' attached to the "Main Camera"
My Error Message I get at any frame (cause its in LateUpdate): "*MissingComponentException: There is no 'Renderer' attached to the "Main Camera" game object, but a script is trying to access it. You...
View ArticleRenderer.enable for GameObject[]?
Hello, I want to to do a renderer.enable = true/false for multiples GameObjects... But I don't know how to do it? GameObject[] doesn't have GameObject functions, so how I can do what I want please?...
View ArticleCannot select Animation Event
I've copied an animation in order to make it R/W, added the component script below to the GameObject, then created an Animation Event. However, I cannot select my function (MeshState) from the list. It...
View ArticleMaking object "Blink"
Hello, I have a coin object that disappears after several seconds of hitting a ground. What I was thinking of doing was making it slowing "blink," eventually blinking rapidly then disappearing. Now, by...
View ArticleSimple coroutine doesn't resume after setting renderer.enabled to false
Hello everyone, I'm trying to make a bonus that starts with a trigger and last for one second. I've made a coroutine for that. here's my simplified code. Here's what I get in the console : About to...
View ArticleHow to make a gameObject invisible in unity
I am attempting to make a Unity gameObject invisible through code. So far I have tried (On a script attached to the gameObject I want to make invisible): `this.renderer.enabled = false` `this.enabled =...
View ArticleOnBecameVisible does not work
I am trying to optimize CPU usage for the game so I stop rendering when the object is out and render it again when it come back to screen. But the second part I can't get it to work. The Cat...
View ArticleMake UI elements invisible
I need to make a UI button invisible, but not by the command SetActive(false) because I need a script on it to run. I tried below commands but none of them works, seems they are obsolete or wrong...
View ArticleHow to make a prefab active and non-active using script?
Hi. So I I have been so much trouble with this and it is making an prefab or object visible or not visible. I have tried using " GetComponent.enabled = true/false" But its not working. I bet I have to...
View ArticleGetComponent ignoring if statement conditions
I'm trying to have objects become visible only when they fall within a particular area, however I'm having some trouble with GetComponent. foreach( Plank plank in planks ) { plank.CreateGameObjects();...
View Article2D project - player respawn delay problem
Hello there! I making some simple 2D side-scroller. Because I'm noob in programming, all my C# scripts for small systems are based on GamesPlusJames tutorials (youtube). Problem starts when I want to...
View ArticleIs it possible to start a game and get GUI-button act as like its already...
Hello, I have a problem because I've created two GUI-buttons that hides/disables and unhides/enables gameObjects renderer. And I need to second one act like its already pressed once when the game...
View ArticleChildren Mesh Render Issues.
I am attempting to turn off all of the child objects SkinnedMeshRenderers and I am using his script: var theObject : GameObject; function Update () { theObject.GetComponentsInChildren.().enabled =...
View ArticleGameobject with many child objects disable mesh not working.
Hi guys, Now this is already a discussed topic and I still did not get how to solve the issue. Problem: I have an architectural building with many child game objects in it. Some having renderer and...
View ArticleFade out menu objects based on rotation of the parent circle?
Hello Everyone, I've been trying to figure this out for a few days now and I could use some help. I feel like there's an easier way than the partial solution I've been working with. Apologies in...
View ArticleDisabling canvas renderer optimization
Unity's [UI optimization tutorial][1] mentions that one way to optimize hiding parts of the UI would be by **Disabling Canvas Renderers**. However, they don't exactly say how this should be done, and I...
View ArticleHiding and showing multiple objects
How do I write a script that can cycle through hiding and showing of five objects. I've tried using GameObject.Find(Torso1) to find my objects and then renderer.enabled to hide and show it, not sure if...
View ArticleThe best methods for changing objects within a scene?
Hello, I've been looking into how to replace a GameObject with another GameObject. Allow me to explain: I have a SpringTree GameObject and a WinterTree GameObject. I already have a script that changes...
View ArticleTurn on/off renderer for objects found with "FindGameObjectsWithTag"
Hello, I'm trying to display a level of a game by enabling the mesh renderer for all the objects in the level once the player reaches a certain checkpoint and collides with it, but I can't seem to make...
View ArticleURP and importing 3d models
Using the default Universal render pipeline template, I noticed that all the 3d models have pink meshes. The objects themselves have the material and everything looks fine when placed in the scene. The...
View ArticleUnity 2019.4.9f1 - Toggle Show/Hide Gameobject with one keystroke.
Hi all. I have constructed a spiral freezer and want to simulate automated cleaning on it. To do that I am making 9 "segments", each consisting of an empty gameobject with several particle systems as...
View ArticleHow can I change the transparency of gameobjects with a dictionary?
I am trying to change the transparency of gameobjects based on their position using a dictionary. I am getting the correct float transparency value, but the actual transparency is not changing. Also,...
View Article