List.count returning 2 different values
I have a list of gameobjects and a for loop itterating through it in 2 seperate functions. In the update function it works as intended and prints the count as expected. Generally just 1 as I am trying...
View ArticleI created a system that tracks number of matches have
so I have a system that add matches when I pick them and removes them when you light a candle, and when you run out you can no longer light candles. I have a UI script that supposed to display a...
View ArticleLists are empty when they aren't supposed to be
I have some code that is meant to dequeue troops and queue them. When I click on the menu items, they are meant to decrease and destroy if they are smaller than 1 and they do this fine but, my lists...
View ArticleHow to Count Characters in an InputField and Display them on TMP Text.
Hey! I'm really new to C# and to give you context regarding my question, I'm making a scene where the player types in their username, however there is a character limit to the InputField. I want to be...
View ArticleCount objects inside a dynamic area?
Hi everyone! After several hours of googling this I can't quite find what I need to do: I need to count the amount of objects in an area created by the player (ex. Cows inside a fenced area made by the...
View ArticleHow can I keep a count of my active objects from my object pool?
I'm coming back to making some games after a long break and my brain is all mush so i need some help on this one. I'm wanting to keep track of how many objects from my Object Pool are active in game...
View ArticleRandomising list of integers and removing them from list once the task...
I have a list of integers (1,2,3,4). Each number corresponds to a switch input in MAX MSP which means if 4 is sent from Unity it is read by MAX MSP and switch input 4 works. (This functions fine as...
View ArticleHow I randomise a list of audio clips in Unity and remove it from the list...
I have 4 audio clips. When I play a press a certain button in Unity, the data is sent to MAX/MSP and the audio is played. I created a list a signals (As shown below in the code). What I want is that,...
View ArticleHow can i decrease lives?
Hello, i'm currently making a 2D platform game. So far i have a script for character movement, item collection and enemy movement. In terms of interface, i have a system of three lives with heart...
View ArticleGet the amout of objects in a given position
Hi, I wanted to know how to get the amount of objects that are in a given position. For example, if the position wold be 0, 2, 5 then it would give me the number of objects at this exact point. Does...
View ArticleScoring bug error with 2 int variables
Hello, I have a small error occurring when trying to add 2 int variables. I have 1 collider on the player game object & a trigger on each of the gameobject that need to pass thru for scoring. the...
View ArticleC# How Add new score to old score in update function
**I have been struggling to get my head round to adding my new score to the old score in update function with Mathf.move towards but not work! score increase to infinity, I use bool, while, limited...
View Articlemany collisions while holding an item
Hello all, I'm sending a massage to the log file when I pick an Item with HTC Vive controller. in my log file I get this: Picked item, name : AppleRed at: 6/25/2017 5:43:17 PM Picked item, name :...
View ArticleFinding the amount of polygons being displayed.
Hello, I am currently developing for Oculus quest and my experience is lagging. I would like to know when it starts to lag (at how many rendered polygons). I am wondering if someone knows away of...
View ArticleConvert code to get prefab then sprite ?
How to convert this code to get prefab or FPS model rather then a sprite image. i try to write gameobject but it doesn't work ?,how we can convert this code to get PREFAB or FBS model rather then...
View ArticleHow to check if player is re-entering the same trigger?
Good day everybody! I have a question about the correct logic for the next trigger: In case A (image below): The trigger in the scene is enabling light each time the player enters the trigger. There're...
View ArticleList give a count of zero when it have 1 element
Like this photo show ![alt text][1] [1]: /storage/temp/137906-list.png the list is showing Count zero when is clear that it have 1 element in it. I have the script execution order set before the script...
View ArticleHow to count Tiles in a sourinding Area around an Object?
I want a object ,that is locked to grid ,to count all tiles, called "field",surounding it with a radius of 3 and than add to a public float called "grain"... roughly like this: void Update() {...
View ArticleRigidbody2D.attachedColliderCount question C#
Is it possible to use this Rigidbody2D.attachedColliderCount to actually count the rigidbodies attached to a sphere? I would like to be able to have a sphere and then hit it with another sphere and...
View ArticleHow to count red colored tiles on my floor?
Hello, My game is 2D. ![alt text][1]I have a flor made out of arond 800 black colored tiles. When player1 moves over them they change to red. How do I count the number of tiles that have been...
View Article