Answer by Pharaoh_
GUI elements are drawn in the OnGUI() method. Have you attached it to a game object? If you have, it should work.
View ArticleAnswer by Pharaoh_
In the Start() method, set InitY = GO.transform.position.y; In the Update() method, Vector3 newVec = new Vector3 (GO.transform.position.x, InitY, GO.transform.position.z);...
View ArticleAnswer by Pharaoh_
Every GUI element (unless you're using GUILayout without using BeginArea()) has a Rect requirement, where you define where each element goes. Top right for instance would be Rect (Screen.width - 100,...
View ArticleAnswer by Pharaoh_
Is there any reason why you play the animation so frequently? Instead, I would use OnCollisionEnter2D() to set the value to true and OnCollisionExit2D to set it to false. In each of these functions,...
View ArticleAnswer by Pharaoh_
Speculation: GetComponent < Player >: You keep adding the same script which causes the script to re-run. Did you mean GetComponent < Entities> ()? Also, why is it that you are inheriting...
View ArticleAnswer by Pharaoh_
Well the guy whose answer was accepted, linked an entry in the manual. That entry is no longer the same; it says it uses arbitrary units and not kilograms, unlike the scale of a mesh, which simulates...
View ArticleAnswer by Pharaoh_
This might be obvious, but why don't you check if the gameobject is not destroyed OnDisable()? As in, if this == null. P.S. From the accepted answer, however, it might be a stupid suggestion.
View ArticleAnswer by Pharaoh_
Well, I didn't notice you wanted to achieve that (I actually wonder what I was thinking). In that case, you can use a `Dictionary < Rect, string >`. Textures are drawn on Rects. Thus, when you...
View ArticleAnswer by Pharaoh_
Just attach an audio source to a game object that will not be destroyed (DontDestroyOnLoad()).
View ArticleAnswer by Pharaoh_
Attach a script on your colliders and make a GUIScriptName gSN variable. OnTriggerEnter(), check the tag of the collider (let's call it col). If col.gameObject.tag == "Enemy" then access the...
View ArticleAnswer by Pharaoh_
ball.transform.position = Vector3.MoveTowards(transform.position, target.position, step); Shouldn't this be (transform.position, target, step)?
View ArticleAnswer by Pharaoh_
Tick Best Fit. Make a tiny change, such as hit spacebar and then delete it to allow the change to occur (it sometimes bugs for me).
View ArticleAnswer by Pharaoh_
Remember that this finds a gameobject by name, not tag, if the latter is what you intended. It will return null when no gameobject with such a name is found.
View ArticleAnswer by Pharaoh_
Pretty much what @Cherno said, but you can use the inbuilt "Ignore Raycast" layer on the character controller.
View ArticleAnswer by Pharaoh_
You need to give your unit some form of an attackDistance property. This will also indicate whether this object is ranged or melee. When your OnTriggerEnter detects an incoming collider, check whether...
View Article