Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 zombieCraig · Jun 23, 2011 at 12:56 PM · characterswitchswitch characters

switching between in game characters

i hope someone can help me

I am trying to create an in game character switch

so you control a character and at the press of a button switch to a nearby character. the original still being there

i did create this at one point but it destroyed the original character and they both need to be on screen

i hope i explained clearly and someone can help thanks

Comment
Add comment · Show 1
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 Peter G · Jul 15, 2011 at 11:56 PM 0
Share

Similar question:

http://answers.unity3d.com/questions/29728/how-is-the-best-way-to-handle-switching-characters.html

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Milad · Jun 23, 2011 at 01:09 PM

One way is you use 2 camera.

When you press the button disable the current camera and enable other camera and vice versa.

I think when you change the character you destroy current character! If you can put your code here!

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 zombieCraig · Jun 23, 2011 at 02:55 PM 0
Share

i can change the camera but i cant change it so the player controls the other character

avatar image Milad · Jun 23, 2011 at 03:04 PM 0
Share

You must disable the control script of current character and enable the other.it is easy.or set a bool true/false with Send$$anonymous$$essage.

avatar image
0

Answer by Chris D · Jun 23, 2011 at 05:19 PM

It would help if you could clarify with a few more details such as the perspective you're using in your game.

If you're doing this in a third-person perspective (i.e. not first person) it would just be a matter of having the camera follow a different transform (that of the new player).

If you're doing this from a first-person perspective, your best bet (as @Milad suggested) is to have one camera per character, positioned as needed, and switch between them depending on who is 'active'.

Either way, to transfer control between characters would be a matter of

  1. disabling Player 1's controls

  2. enabling Player 2's

You'd toggle Behaviour.Enabled for the script you're using to control the character.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Complex character switching 1 Answer

changing player (getting in vehicles) 3 Answers

Access other gameObject's components in C# script 1 Answer

switch character 1 Answer

Switch between characters and follow? 3 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