Making 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