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 sam32x · Aug 13, 2012 at 09:35 AM · meshcharactersomething

swapping meshes

im making a fighting game and when a character punches or something instead of them moving i want it to be instant like in retro fighting games, so instead of having an animation i would just swap the mesh (the animations are broken in my 3ds max anyway). i could just delete the old mesh and instantiate a new one but there must be an easier way so does anyone know it?

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 ScroodgeM · Aug 13, 2012 at 06:55 PM

you can make two or more geometry on each other a simple disable all renderers except one. whenever you need just re-enable them all to another combination to get another renderer enabled

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 sam32x · Aug 14, 2012 at 08:52 AM 0
Share

too late i already wrote the script lol

 var punchControl : String;
 var jumpControl : String;
 var kickControl : String;
 var leftControl : String;
 var rightControl : String;
 var blockControl : String;
 var crouchControl : String;
 var canPunch = 1;
 var canJump = 1;
 var can$$anonymous$$ick = 1;
 var health = 100;
 var shown$$anonymous$$esh : GameObject;
 var idle$$anonymous$$esh : GameObject;
 var punch$$anonymous$$esh : GameObject;
 var jump$$anonymous$$esh : GameObject;
 var jump$$anonymous$$ick$$anonymous$$esh : GameObject;
 var crouchPunch$$anonymous$$esh : GameObject;
 var block$$anonymous$$esh : GameObject;
 var standPos = 1;
 var blocking = 0;
 var punchDamage = 3
 var kickDamage = 5;
 var jump$$anonymous$$ickDamage = 6;
 var crouchPunchDamage = 4;
 var damage$$anonymous$$ultiplier = 1;
 
 function Update () {
 if(blocking == 1){
 damage$$anonymous$$ultiplier = 0.2;
 }
 if(blocking == 0){
 damage$$anonymous$$ultiplier = 1;
 }
 if(Input.Get$$anonymous$$eyDown("punchControl")){
 if(blocking == 0){
 if(canPunch == 1){
 if(standPos == 1){
 Punch();
 }
 }
 }
 if(blocking == 0){
 if(canPunch == 1){
 if(standPos == 0){
 CrouchPunch();
 }
 }
 }
 }
 if(Input.Get$$anonymous$$eyDown("kickControl")){
 if(blocking == 0){
 if(can$$anonymous$$ick == 1){
 if(standPos == 1){
 $$anonymous$$ick();
 }
 }
 if(can$$anonymous$$ick == 1){
 if(standPos == 2){
 Jump$$anonymous$$ick();
 }
 }
 }
 }
 if(Input.Get$$anonymous$$ey("leftControl")){
 if(blocking == 0){
 $$anonymous$$oveLeft();
 }
 }
 if(Input.Get$$anonymous$$ey("rightControl")){
 if(blocking == 0){
 $$anonymous$$oveRight();
 }
 }
 if(Input.Get$$anonymous$$eyDown("jumpControl")){
 if(blocking == 0){
 if(canJump == 1){
 if(standPos != 2){
 Jump();
 }
 }
 }
 }
 if(Input.Get$$anonymous$$eyDown("crouchControl")){
 if(blocking == 0){
 if(standPos != 2){
 CrouchDown();
 }
 }
 }
 if(Input.Get$$anonymous$$eyUp("crouchControl")){
 if(blocking == 0){
 if(standPos == 0){
 crouchUp();
 }
 }
 }
 if(Input.Get$$anonymous$$eyDown("blockControl")){
 if(standPos == 1){
 if(can$$anonymous$$ick == 1){
 if(canPunch == 1){
 if(canJump == 1){
 BlockDown();
 }
 }
 }
 }
 }
 if(Input.Get$$anonymous$$eyUp("blockControl")){
 if(blocking == 1){
 BlockUp();
 }
 }
 }
 
 function Punch () {
 canPunch = 0;
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(jump$$anonymous$$esh,transform.position,transform.rotation);
 Invoke("EndPunch",0.3);
 }
 
 function EndPunch () {
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(idle$$anonymous$$esh,transform.position,transform.rotation);
 canPunch = 1;
 
 function $$anonymous$$ick () {
 can$$anonymous$$ick = 0;
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(kick$$anonymous$$esh,transform.position,transform.rotation);
 Invoke("End$$anonymous$$ick",0.5);
 }
 
 function End$$anonymous$$ick () {
 can$$anonymous$$ick = 1;
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(idle$$anonymous$$esh,transform.position,transform.rotation);
 }
 
 function $$anonymous$$oveLeft () {
 transform.Translate(Vector3.left * Time.deltaTime * 3);
 }
 
 function $$anonymous$$oveRight () {
 transform.Translate(Vector3.right * Time.deltaTime * 3);
 }
 
 function Jump$$anonymous$$ick () {
 can$$anonymous$$ick = 0;
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(jump$$anonymous$$ick$$anonymous$$esh,transform.position,transform.rotation);
 Invoke("End$$anonymous$$ick",1);
 }
 }
 
avatar image sam32x · Aug 14, 2012 at 08:53 AM 0
Share
 function Jump () {
 standPos = 2;
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = instantiate(jump$$anonymous$$esh,transform.position,transform.rotation);
 Invoke("EndJump",0.5);
 }
 
 function EndJump () {
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(idle$$anonymous$$esh,transform.position,transform.rotation);
 }
 
 function CrouchDown () {
 standPos = 0;
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(crouch$$anonymous$$esh,transform.position,transform.rotation);
 }
 
 function CrouchUp () {
 standPos = 1;
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(idle$$anonymous$$esh,transform.position,transform.rotation);
 }
 }

 
 function BlockDown () {
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(block$$anonymous$$esh,transform.position,transform.rotation);
 blocking = 1;
 canPunch = 0;
 can$$anonymous$$ick = 0;
 canJump = 0;
 }
 
 function BlockUp () {
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(idle$$anonymous$$esh,transform.position,transform.rotation);
 blocking = 0;
 canPunch = 1;
 can$$anonymous$$ick = 1;
 canJump = 1;
 }
 
 function CrouchPunch () {
 Destroy(shown$$anonymous$$esh);
 shown$$anonymous$$esh = Instantiate(crouchPunch$$anonymous$$esh,transform.position,transform.rotation);
 canPunch = 0;
 Invoke("EndPunch",0.3);
 }
 
 function OnCollisionEnter (something : Collider) {
 if(something.Collider.tag == "punch"){
 health -= punchDamage * damage$$anonymous$$ultiplier;
 }
 else
 if(something.Collider.tag == "kick"){
 health -= kickDamage * damage$$anonymous$$ultiplier;
 }
 else
 if(something.Collider.tag == "jumpkick"){
 health -= jump$$anonymous$$ickDamage * damage$$anonymous$$ultiplier;
 }
 else
 if(something.Collider.tag == "crouchpunch"){
 health -= crouchPunchDamage * damage$$anonymous$$ultiplier;

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

8 People are following this question.

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

Related Questions

How do I keep separate meshes for a character when I import it into Unity? 1 Answer

translating an accessory from source mesh to a targeted mesh 0 Answers

Why is my animated with Mecanim character (enemy) not visible in game (play) mode? 1 Answer

Character Animation Pose Mesh,Animated Pose Mesh 0 Answers

Offset transformer when I import mesh? 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