vWest
vWest
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
No description
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
(the script class has the same name as the file)
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
it isnt working, i have tried a different solution by creating a new script but when i try and drag it onto the spaceship i get this error message 'Can't add script component 'ShowSpaceship' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.'
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
is there any chance we could hop into a call so i could try and explain it?
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
item collection is the other script im trying to referance from'
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
ok i have fixed it by just pasting the code above phew
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
i have done something (im not sure what) and now the player is destroyed instead of the item
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
IT HAS GONE FROM BAD TO WORSE
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
but when i collect all three objects it doesnt reappear
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
when i run the code the object disappers
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
i think my problem may be even simpler than that
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
thank you for that, i understand some of that, but when i say im new to c# i have so very little knowledge of it at all that I dont know how to even pass something by referance
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
this is what i have to make it disapper and re appear
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
public class Finish : MonoBehaviour { public void Update() { if (itemcollection.item == 3) { gameObject.SetActive(true); } else { gameObject.SetActive(false); } }
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
this is the script for the item
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
public class itemcollection : MonoBehaviour { static public int item = 0; [SerializeField] private Text itemText; public void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("item")) { Destroy(collision.gameObject); item = item + 1; itemText.text = "Fuel: " + item; } } }
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
i will paste the current code for it
34 replies
CC#
Created by vWest on 3/12/2024 in #help
Trying to get a game object to disappear and re-appear when a certain number of items are collected.
(for some context i have to get the item from a different script)
34 replies