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 Dinart Filho 1 · Nov 24, 2010 at 12:44 AM · playerobjectcharacterchange

How to Change a character??

Hi, I think about a game that I can change the character by using an item, just like "if I eat meat my character becomes a dog" but this dog has his own movements and powers, a complete new character, so just change the meshfilter will not work, how can I do this??

Thanks!

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
1
Best Answer

Answer by Meltdown · Nov 24, 2010 at 05:44 AM

What you may want to try is simply keeping an array of GameObjects that your character can turn into.

So lets say you have 3 possible animals your character can change into.. Mouse, Cat and a Dog

You load the Mouse, Cat and Dog game objects. But you keep Cat and Dog invisible.

So if you start as a mouse, and you each cheese, you turn into a cat by either hiding the mouse object, and making visible the cat object with the new transforms the mouse had. Then do the same when the cat becomes the dog. Simply hide the cat object, and load/make visible the dog object with the transforms the cat had.

You might also want to look at Instantiate and Destroy methods on the Object class for more information on what is the most efficient way to do this.

Comment
Add comment · Show 2 · 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
avatar image Dinart Filho 1 · Nov 24, 2010 at 02:36 PM 0
Share

But that way it will be messed, I think, because if each character walk in different speeds and have different powers (fly, walk, swim etc) with time they will be far away one of other.

avatar image Meltdown · Nov 29, 2010 at 02:59 PM 0
Share

You will only be controlling one character at once right? And you want your existing character to change in the same place to your new character??

What you can do just before change is set the position of your new character to the position of the old character, and then change it to that. Also you can set in code your character to active, or not active, and check for that, if character is not active, don't do any movement.

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

No one has followed this question yet.

Related Questions

How to change characters with pressing a button 0 Answers

Changing player object UNET 1 Answer

how to change object 0 Answers

When Near Object, Change Scene 0 Answers

Activate Object with trigger and if leave then inactivate 2 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