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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by IKilledKenny_2 · Mar 21, 2015 at 03:11 PM · collisionrigidbodycollidercharactercontroller

Move Player With Capsule Collider

Hello Unity3D.I have a problem with my CharacterController.The problem is when i add for the to opponent or my character.My character moves but the charactercontroller doesn't move to the new spot that its suppose to move to.For example.When i throw a fireball at the opponent the fireball moves the opponent but it doesn't move to the new vector that it suppose to move to.Is there a way that i can push the charactercontroller to the new vector and it stays to the new vector?Or is there a way that i can make my characters move around using the capsule collider?If anyone knows how i can do this.Can you please tell me how?Sorry if this question makes no sense....

Also Heres the script if anyone needs it

 #pragma strict
 var Run:AudioClip;
 var rotationSpeed : float = 10;
 var walkSpeed : float = 7;
 var body : Transform;
 
 
 private var  yRot: float;
 function Update () {
     var Controller : CharacterController = GetComponent(CharacterController);
     var vertical : Vector3 = transform.TransformDirection(Vector3.forward);
     var horizontal : Vector3 = transform.TransformDirection(Vector3.right);
     var height : Vector3 = transform.TransformDirection(Vector3.up);
 
 
     
 
         
 
     
     
     
     if(Input.GetAxis("Vertical")||Input.GetAxis("Horizontal")){
         if (!animation.IsPlaying("Jump"))
             if (!animation.IsPlaying("Jump"))
     if(!animation.IsPlaying("Reverse_Crescent"))
     if(!animation.IsPlaying("Crescent"))
     if(!animation.IsPlaying("Spinning_back_kick"))
     if(!animation.IsPlaying("Spinning_back_kick2"))
     if(!animation.IsPlaying("Jump_Spinning_Back_Kick"))
     if(!animation.IsPlaying("Astral_Ball"))
     if(!animation.IsPlaying("Hit1"))
     if(!animation.IsPlaying("Are_You_Ready_"))
     if(!animation.IsPlaying("Kick_Combo"))
     if(!animation.IsPlaying("para_kick"))
     if(!animation.IsPlaying("Aerial_Cartwhell"))
     if(!animation.IsPlaying("Aerial_Cartwhell_Reverse"))
     if(!animation.IsPlaying("Snap_Kick"))
     if(!animation.IsPlaying("Thrust_Kick_2"))
         if(!animation.IsPlaying("Teleport"))
         animation.CrossFade("Run2");
         animation["Run2"].speed = walkSpeed/100;
         
         Controller.Move((vertical * (walkSpeed * Input.GetAxis("Vertical"))) * Time.deltaTime);
         Controller.Move((horizontal * (walkSpeed * Input.GetAxis("Horizontal"))) * Time.deltaTime);
         audio.Play();
 }else{
     if (!animation.IsPlaying("Jump"))
 if(!animation.IsPlaying("Wing_Chun_Punch"))
     if(!animation.IsPlaying("Palm1"))
     if(!animation.IsPlaying("Palm2"))
     if(!animation.IsPlaying("palm3"))
     if(!animation.IsPlaying("BoeTon_Pause"))
     if(!animation.IsPlaying("Hit1"))
     if(!animation.IsPlaying("Hit1_Reverse"))
     if(!animation.IsPlaying("Hit_Stomach"))
     if(!animation.IsPlaying("Hit_Flying"))
     if(!animation.IsPlaying("Oh_Hell_To_The_Fuck_Nah_"))
     if(!animation.IsPlaying("Mana_Barrage"))
     if(!animation.IsPlaying("Teleport"))
     if(!animation.IsPlaying("Stand_Air_Hit_back"))
     if(!animation.IsPlaying("Shinzuroken_End2"))
     if(!animation.IsPlaying("Shinzuroken_End"))
     if(!animation.IsPlaying("Violets_Bicycle_Kick_Hit_Part_One"))
     if(!animation.IsPlaying("Violets_Bicycle_Kick_Hit_Part_Two"))
     if(!animation.IsPlaying("Air_Hit_Going_Up"))
     if(!animation.IsPlaying("Shinzuroken_Middle"))   
     if(!animation.IsPlaying("Shinzuroken_Start"))
     if(!animation.IsPlaying("Shinzuroken_Hit"))
     if(!animation.IsPlaying("blast_attack"))
     if(!animation.IsPlaying("Fire_Eruption"))
     if(!animation.IsPlaying("Fireball_Attack"))
     if(!animation.IsPlaying("BoeTon_Pause2"))
     if(!animation.IsPlaying("Berserk"))
     if(!animation.IsPlaying("Burn_To_Hell_"))
     if(!animation.IsPlaying("Burn_To_Hell_Part_2"))
     if(!animation.IsPlaying("Fire_Imp_Summon"))
     if(!animation.IsPlaying("Fire_fury"))
     if(!animation.IsPlaying("Gigantic_FireBall_Part_2"))
     if(!animation.IsPlaying("Holy_Roar_Hit_Animation"))
     if(!animation.IsPlaying("Berserk_Part_2"))
     if(!animation.IsPlaying("Fast_Jab"))
     if(!animation.IsPlaying("Fast_Jab_2"))
     if(!animation.IsPlaying("Fast_Jab_3"))
     if(!animation.IsPlaying("Fast_Jab_4"))
     if(!animation.IsPlaying("Fast_Jab_5"))
     if(!animation.IsPlaying("Flaming_Back_Kick"))
     if(!animation.IsPlaying("Flaming_Back_Kick_2"))
     if(!animation.IsPlaying("Flaming_Back_Kick_3"))
     if(!animation.IsPlaying("Kick_Combo_4"))
     if(!animation.IsPlaying("Kick_Combo_3"))
     if(!animation.IsPlaying("Kick_Combo_2"))
     if(!animation.IsPlaying("Kick_Combo_1"))
     if(!animation.IsPlaying("Elbow_Hit_2"))
     if(!animation.IsPlaying("Boetons_Stunner"))
     if(!animation.IsPlaying("Boetons_Launcher"))
     if(!animation.IsPlaying("Rising_knee"))
     if(!animation.IsPlaying("Assassin_s_Greeting_Hit_1"))
     if(!animation.IsPlaying("Assassin_s_Greeting_Hit_2"))
     if(!animation.IsPlaying("Assassin_s_Greeting_Hit_3")) 
     if(!animation.IsPlaying("Assassin_s_Greeting_Hit_4"))  
     if(!animation.IsPlaying("Assassin_s_Greeting_Hit_5"))
     if(!animation.IsPlaying("Assassin_s_Greeting_Hit_6"))
     if(!animation.IsPlaying("Assassins_Greeting_Part_7_Hit"))
     if(!animation.IsPlaying("Assassins_Greeting_Part_8_Hit"))
     animation.CrossFade("Stance_White_Fang");
     animation["Stance_White_Fang"].speed = 0.5;
 
     
 
     }
     
     
     
 }    
 function LateUpdate(){
   // Rotate the Character to match the direction he/she is going
   if(Input.GetAxis("Vertical") == 0){
     if(Input.GetAxis("Horizontal") > 0){
       body.localEulerAngles.y = 90;//Right sideways running
     }else if(Input.GetAxis("Horizontal") < 0){
       body.localEulerAngles.y = 270;//Left sideways running
 
       
     }
   }else if(Input.GetAxis("Vertical") > 0){
     if(Input.GetAxis("Horizontal") > 0){
       body.localEulerAngles.y = -270;
     }else if(Input.GetAxis("Horizontal") < 0){
       body.localEulerAngles.y = -90;
     }
   }else if(Input.GetAxis("Vertical") < 0){
     if(Input.GetAxis("Horizontal") == 0){
       body.localEulerAngles.y = -180;
     }else if(Input.GetAxis("Horizontal") > 0){
       body.localEulerAngles.y = -180;
     }else if(Input.GetAxis("Horizontal") < 0){
       body.localEulerAngles.y = -180;
     }
   }
 }                  
 
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

Answer by XinJinXiang · Mar 26, 2015 at 03:23 PM

Have you checked static for your gameobject?

Comment
Add comment · Show 3 · 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 IKilledKenny_2 · Mar 26, 2015 at 04:12 PM 0
Share

No I Do Not have static checked.But is there a way that i can make my character move with this script with a capsule collider ins$$anonymous$$d of a charactercontroller?

avatar image XinJinXiang · Mar 26, 2015 at 05:10 PM 0
Share

Yeah! You can do it. But you should checked rigidbody freeze rotation. Then it will work fine.

avatar image IKilledKenny_2 · Apr 01, 2015 at 04:18 PM 0
Share

Sorry that this is late....but i have checked it and the capsule collider still doesn't move is there any other way?like,for example.Do i need to change anything in the script or do i need to change the character gravity or do i need to change my animation speed?

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

22 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 avatar image avatar image

Related Questions

My Character controller is being push a little bit when i'm about the get the coins. How can i possibly detect collision and destroy the coins without actually getting affected by the colliding physics? 1 Answer

Collision between CharacterControllers 1 Answer

Making Colliders/Triggers or Rigidbodies move a Character Controller 5 Answers

Problem with rigidbodys and box collider 1 Answer

OnCollisionEnter does not work 4 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