Answer by ransomink
Only the last one is shown because you're overwriting `text.text ` multiple times. It is working but each line replaces the previous one until the final call (which is the result you see)...
View ArticleAnswer by ransomink
You can do at least two different approaches: The first one rounds the float to two decimal places to avoid floating point imprecision. private int _iteration; private float _timer = 0f; void...
View ArticleAnswer by ransomink
There are Unity Assets for multiple tags. I'd check them out if you're really interested. Besides that, you can use inheritance if that's what you're thinking about. Is it something like, a sword is an...
View ArticleAnswer by ransomink
If it's the only camera inside the scene and tagged as MainCamera, just use View = Camera.main; to set as a reference - The easiest solution is to create a public variable and drag-n-drop the camera...
View ArticleAnswer by ransomink
pos = new Vector3( valueX, valueY, valueZ ); First, you set the `pos ` variable based on your *valueX*, *valueY*, and *valueZ* but they are private (not accessible in the inspector and are changed...
View ArticleAnswer by ransomink
Just drag the scripts back onto your game objects and everything will work fine...
View ArticleAnswer by ransomink
If you already know the position you want the player to move to, check if the player collided with the trigger and set it to the teleport position [SerializeField] private Transform teleport; private...
View ArticleAnswer by ransomink
you have to click on the sprite sheet from your project folder and change the pixels per unit. A smaller number increases the sprites' size in the scene...
View ArticleAnswer by ransomink
Restricted Asset means the author of the asset has their own specific license terms. Typically, if/when you download a restricted asset, a license file is contained within the package; read and follow...
View ArticleAnswer by ransomink
you don't need to download any assets to make a game. some tutorials download assets to use in their video/blog but it's not necessary. you can use the provided primitive shapes and create simple...
View ArticleAnswer by ransomink
Is your bigBrother game object already in the scene? If it is, then you just need to do: `bigBrother.SetActive(true);` when the object's collide ---------- If you want to spawn your bigBrother object...
View ArticleAnswer by ransomink
Your code looks fine, I believe you are using the prefab of the spider instead of the one from the scene and that is causing the issue...
View ArticleAnswer by ransomink
You're not getting the Slider component, it should be: `FuelShower = GameObject.Find("FuelShower").GetComponent();`. Also, if the game object is already in the scene, it's easier to drag it into the...
View ArticleAnswer by ransomink
The Text component has a `fontSize ` property. Make sure to check the docs for information on the class you're utilizing: [UI.Text][1] [1]:...
View ArticleAnswer by ransomink
You can't use a Rigidbody component with a CharacterController. The CharacterController component handles its own simulation, so remove the Rigidbody component
View ArticleAnswer by ransomink
If you know both points of the line you can simply use Physics2D.Linecast. Including that, either a Raycast or CircleCast will all work depending on how you want to detect the ball. [Raycast][2] is a...
View ArticleAnswer by ransomink
You are declaring a local `MousePos ` variable in your Update method; this value is being used in your Instantiate method because both are in the same scope. Your class variable `MousePos ` is not...
View ArticleAnswer by ransomink
Using `FindWithTag ` is okay is used in Awake or Start. Just best to avoid in Update, methods called multiples times per frame or often. FindWithTag will return a `GameObject ` type but your list is a...
View ArticleAnswer by ransomink
Easiest solution is to create a dictionary with a collider as the key and coroutine as the value private Coroutine _routine; private Dictionary _colliders; ---------- In DealDamage, after assigning the...
View ArticleAnswer by ransomink
Inside your foreach loop, you get the `Text ` component: this is Unity's UI Text component, not Text Mesh Pro's. First, make sure you have `using TMPro; ` to access any Text Mesh Pro class and get the...
View Article