- Home /
Help with adding power ups to game
Hey guys im new to unity and i have a basic 2d space shooter game already made.. (The enemy's fall down at a random position and speed and the player shoots them etc.) The next step is my second scene or level... I want a box with a question to fall witch if the user grabs it before it goes of screen could give the user extra points or a shield of cover to protect him from the enemy's hitting him... so my question is how do i make a shield appear around the player...this shield will also have a health bar....
Any help will be appreciated(if u show code please use C sharp if that okays) I just looking for some logic or easy idea on how to go about this
Answer by AngryOldMan · Mar 18, 2011 at 10:58 PM
Do it yourself and when you encounter a problem post the script here and ask a specific question. This isn't a place where you can just ask for code and expect someone to give it to you. Try this, make the "pickup" have a collider and put a script on it that uses OnTriggerEnter, which only works when a player moves into the trigger area, so you would have to set a send message function which works when the pickup moves into/collides with the pickup which sends a message to the pickup to activate and do whatever it is you want to the player.
Your answer
Follow this Question
Related Questions
Cannot pick up an object that is the child of another robject? 0 Answers
trying to use lists to pickup an object and put in inventory 1 Answer
An extremely stupid question... I'm a newbie 3 Answers
Instantiating Prefabs around a point other than zero to create a circle 3 Answers
How do I display text in current Unity in the first roll-a-ball project? 1 Answer