- Home /
Basically how to make a fan in Unity2D
I’ve been working on my game for a couple of months (REALLY JUST A COUPLE OF WEEKS) and I had an idea for the Player. Right now my player can jump, run, walk, and play the Idle animation. Basically, I want my Player to act like a fan when the G key is pressed but instead of blowing(forcing to a certain direction) the 2D GameObjects away the Player pulls them forward on his right side when he is facing right or pull them forward on his left side when he is facing the left side. By the way, I’m not asking you to code me this entire question, but advice followed by a little code, tips, and sources will help. – Also, I’m a noob with Game Dev.
Answer by Zeusko · Aug 10, 2017 at 09:08 AM
Maybe, you could have a polygon collider(trigger) in the area, where you want objects to be affected. Then you would attach either Area Effector or your own script which woulf apply forces to the objects in the area (you could turn this component on/off whether the G button is pushed). You could change the collider position by the direction the player is facing or just change the scale to negative.
Your answer
Follow this Question
Related Questions
Default Contact Offset Problems 1 Answer
Bombs as locomotion in 2D platformer 0 Answers
Player 2D getting stuck while moving 2 Answers
How do I do a Snappy Jump in 2D with a 2D Jump Script? 0 Answers
Jumping from special jump orb 1 Answer