Cannot 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 ArticleHow do I make different gameobjects appear, every time you click the GUI.button?
To make my question more clear, I want it so that when you click the button in the middle of the screen, a picture comes up, then every time you click it a different picture comes up,at a random...
View ArticleTrying to make a renderer blink on and off, it's not working but I get no...
Here is my code: IEnumerator blinkTime () { if (blinking == true) { blinkTimeOn = true; while (blinkTimeOn == true) { renderer.enabled = false; yield return new WaitForSeconds (1f); blinkTimeOff =...
View Articlerenderer.enable = photon?
0n my objects I have included a script to enable/disable 2 points of weapons (sheathed and wielded) in the game, over the network when I press the corresponding button to enable/disable the mesh' all...
View ArticleKeypress.ismine?
how do I say "if I press the key, ALL clients should see MY player's change?" Photon RPC calls seem to affect my code in ways that appear to be close, but no cigars. using UnityEngine; using...
View ArticleSetting 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 Article