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 berting01 · Nov 06, 2011 at 05:23 AM · animationmovementblender

problem with character motion and movement

I have a problem with my characters. I find it hard to create its motion and movements. Can you suggest some ideas that can help me do it better or where can I get characters that aready has basic movements like running and walki for free

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 syclamoth · Nov 06, 2011 at 12:03 PM 0
Share

Yeah, like the standard assets? Just look around, it's not that hard.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by aldonaletto · Nov 06, 2011 at 04:34 PM

Usually using CharacterControllers is the best thing to do. You can start with the CharacterController.Move example of movement script - it's easy to understand and modify. Just to have an idea, the script below is the example script with run and mouse control to turn left/right:

var walkSpeed : float = 6.0; var runSpeed : float = 9.0; var turnSpeed : float = 90; // speed to turn left/right

var jumpSpeed : float = 8.0; var gravity : float = 10.0;

private var moveDirection : Vector3 = Vector3.zero; private var angles : Vector3 = Vector3.zero;

function Update() {

 var controller : CharacterController = GetComponent(CharacterController);
 
 // turn left/right (around Y) with mouse X
 angles.y = (angles.y + Input.GetAxis("Mouse X")*turnSpeed*Time.deltaTime) % 360;
 transform.localEulerAngles = angles;

 if (controller.isGrounded) {
     moveDirection = Vector3(Input.GetAxis("Horizontal"), 0,
                             Input.GetAxis("Vertical"));
     moveDirection = transform.TransformDirection(moveDirection);

     // define speed
     var speed = walkSpeed; // assume walkSpeed, but if shift pressed...
     if (Input.GetKey("left shift")) speed = runSpeed; // change to runSpeed
 
     moveDirection *= speed;
     if (Input.GetButton ("Jump")) {
         moveDirection.y = jumpSpeed;
     }
 }
 // Apply gravity
 moveDirection.y -= gravity * Time.deltaTime;
 // Move the controller
 controller.Move(moveDirection * Time.deltaTime);

}

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 berting01 · Nov 07, 2011 at 02:28 AM 0
Share

what i mean here is the animation itself but thanks for the codes

avatar image aldonaletto · Nov 07, 2011 at 03:03 AM 0
Share

You should post another question with a title like "How to add animations to my character?" - I know too little about animations to tell you something useful.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

animation in blender to unity 0 Answers

character movement script 1 Answer

Hungry Shark Evolution Movement 0 Answers

Strange Character Movement (Mecanim) 0 Answers

hypercube animation 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