- Home /
How do i generate random types of sprites in game ?,Can i set a variable to an image asset ?
Hi I am new to unity and I am trying to develop a game where a random image(sprite) will spawn at the middle of the screen and the user has to classify it by moving to 1 out of 2 areas. For example: An image(sprite) of a parrot is spawned and the user has to move it to 'bird area' or 'animal area'. To do this i have created 2 box colliders for the areas and a sprite for the moveable object. The problem is how do I detect at run-time that the user has made the correct choice ? I am just randomly changing the image shown on the sprite as ().sprite = imageList[rand]. This way the images are changing as the objects trigger each other but how do I detect the right answer ? Please help this is Urgent ,I am trying to build a simple classification game where an image appears in the center of the screen and the user has to classify it by moving it to one out of 2 areas. For example, a parrot appears on the screen and my 2 areas are bird or animal. The user then moves it to one of them. How do i detect whether the correct choice has been made ? Currently i have made 2 box colliders for the 2 areas and have 1 sprite in the center. Every time the sprite in the center collides with either of the 2 boxes, i change the sprite component of the sprite renderer. Thus a new image is set onto the sprite every round. But how do i know whether the particular image is moved to the correct side as I dont know whats in the image.... Please Help I am desperate.
Your answer
Follow this Question
Related Questions
Unable to drag image from Assets folder to Sprite: None under Sprite Renderer. 0 Answers
Error facebook profile picture 1 Answer
Sprite Renderer unlit on devices when using Unity 5.2.0 0 Answers
How to choose a size/resolution for the sprites used as game assets in Unity2D ? 2 Answers
Problem with a Bool 1 Answer