I want to make my coin dissapear when my player collides with it but code doesn't work

I just started coding so i still have so much to learn. Unity doesn’t give any error when I play the game but also nothing happenes when the player touches the gold. I want the gold to dissapear when the playes touches it but I don’t know why it doesn’t work. (collision part is the… Read More I want to make my coin dissapear when my player collides with it but code doesn't work

While a variable is greater than zero, how do I activate 2 definitions at once?

import time health = 100 kidsHP = 10 def kidsenemyattack(): global health print(‘The enemy deals damage!’) health -= 4 print(health) print(‘==========’) time.sleep(3) kidsenemyattack() def kidfight(): global kidsHP ready = input(‘You can attack!’) if ready in [‘1′,’one’,’One’]: kidsHP -= 1 time.sleep(2.5) while health > 0: kidsenemyattack() and kidfight() if kidsHP <= 0: print(‘You’ve defeated the evil… Read More While a variable is greater than zero, how do I activate 2 definitions at once?

Javascript function returns undefined when I try and detect collision detection

I am trying to detect if a rectangle collides with a circle but whatever I try it returns undefinded. Here is the code I am using. The relevant code starts around the RectCircleColliding class. const canvas = document.getElementById(‘canvas1’); const c = canvas.getContext(‘2d’); let playing = true let mainMenu = false let cutscenes = 0 let… Read More Javascript function returns undefined when I try and detect collision detection

When i used OnTriggerEnter2D with Input.GetKey the input won't work

When i press the key the the scene won’t load, when i remove the input statemen, it works. can anyone help me ? void OnTriggerEnter2D(Collider2D other) { if(Input.GetKey(KeyCode.X)){ Loader.Load(Loader.Scene.Shop); } } >Solution : This is because OnTriggerEnter2D method is called only once when the obstacle enters the collider’s area. As soon as the obstacle enters,… Read More When i used OnTriggerEnter2D with Input.GetKey the input won't work