Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by CodingNoob · Apr 01, 2015 at 09:07 AM · 2d2d platformerpoweruppower-up

Unity 2D - Yoshi styled "PowerUp"-Creature

Hey there,

i need a little help - again. I'm trying to create a Power Up which allows my player to fly around (it's an infinite runner), an basically it shall be a creature, on which the character hops on and then rides it. I got the mechanics for the "flying" (basically it works like a jetpack...), but what I'm struggling with is how to change the sprite and colliders of my character. Of course, while riding the creature, my character shall not touch the ground by himself,but the creature shall do. So I thought of 2 methods:

1: animate that whole thing. Create a new animation sprite which includes the player and the creature, change the colliders and everything during that animation. As soon as picking up the creature, the actual PowerUp-Object is destroyed and the animation plays. I guess this is very intensive in terms of performance...

2: create the creature as a child-gameobject of the character and set it active by picking up the powerup and deactivate it afterwards until the power up is picked up again... but in this method there is still the question about the collisions - how could I tell the character, that he doesn't "fall through" the creature but keeps sitting at it. If the creature touches the ground, it may run (what else?!...)

I also thought about picking up the whole creature and attach it as child as soon as the player hits it, but that caused some weird issues which were related to the fact that the power up might be spawned several times during the run (at least I guess the issue was in relation to that).

Has anyone done something comparable or an idea how to best realize that? Would be awesome! Thanks in advance!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by tiagojcosta29 · Apr 01, 2015 at 02:07 PM

You can attach the creature as a child with the coliders, and then you can activate/deactivate the whole thing by script. So when you pick the power up, you just need to turn it on and the new coliders will be there.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2D platformer - character clips into the ground 1 Answer

Controller Button Issues 0 Answers

In my 2D platformer game, how would I create a height marker?, 1 Answer

How do i make my player sprite change, when entering a powerup? 1 Answer

Player has jittery and slow movement when child of an animated object. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges