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 erlo68 · Feb 24, 2015 at 06:26 AM · c#movementplayer3dobject

How do i use animated Objects as a player?

Hello,

I am pretty new to Unity and am currently trying to move my "Player".

But it won't move at all, the only thing that worked was turning it using transform.Rotate().

I guess it has something to do with what my "Player" is made of.

Right now i somewhat made a Voxel-like charakter like the Charackters out of the game "Trove" completely out of cubes in Unity, because i don't know how to use 3D modelling-programmes. And i even already animated it (idle, walking...).

alt text

So it consists out of a lot of animated 3D Objects. The Basic Group (My Character) containing the Bodyparts has attached the Transformer, an Animation Handler, the Character Controller, and the Controller Script. Each bodypart just has the Transformer, and the individuel cubes each have the Transformer, the Mesh Filter, The Box Collider and the Mesh Renderer.

After much trial and error i applied the most basic movement i could find and it still won't work... so i applied the same script to a capsule and it works totally fine...

Is the whole way i am doing this wrong and i should use something like Blender or am i just missing something?

For those who want to look at it closer i attach My Assets containing my "Player" the Scene and everything else vital.

PS: I'am german so sorry for my probably bad english :D

Edit: I applied a new scirpt only containing the basic movement code mentioned in my comment below, now my Character moves only up, does anyone know why? Then i made a new Character containing 3 capsules, applied the basic movement script, and even animated it, no Problems at all... tried the same using 2 cubes... it moves for like 1 sec and then gets stuck or it can only jump. Does the Character Controller have some problems with cubes or what?

unbenannt.png (237.4 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by erlo68 · Mar 06, 2015 at 05:55 PM

OK i found a solution.

I read that "roughe collider" cause the character controller to try to climb over itself, so i just had to remove all the colliders! :)

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

Answer by toddisarockstar · Feb 24, 2015 at 07:04 AM

you need to put your movement script in your question. so we can see if that is the problem. it is possible for animation positions to override world positions if you dont have a proper parent assigned to move the group, but my guess is that the problem is in your script.

and btw way, i am super impressed that you actually did this without a 3d program!

3d max is the best. if you cant get 3dmax going then get Blender!

it way easier after you take the time to learn them. they are way faster and you can do so much more!

unity is an exelently designed game engine. the more i learn the more i know the sky is the limit! but whatever you figured out with unity to make caracters is a waste. you will find out soon that it just doesnt do everything you need to do with creating characters.

take the time to learn blender or 3dmax instead!

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 erlo68 · Feb 24, 2015 at 07:24 AM 0
Share

Oh thx, but if you only use cubes with coordinates it is pretty easy to do something like this ^^

This is the Basic code working for the Capsule but not for my Player:

 if (_characterController.isGrounded) 
         {
             moveDirection = new Vector3(Input.GetAxis("Horizontal"),0,Input.GetAxis("Vertical"));
             moveDirection = transform.TransformDirection(moveDirection);
             moveDirection *= speed;
             if(Input.GetButton("Jump"))
             {
                 moveDirection.y = jumpSpeed;
             }
         }
             moveDirection.y -= gravity * Time.deltaTime;
             _characterController.$$anonymous$$ove (moveDirection * Time.deltaTime);

It won't let me Upload my Player_Controller.cs, so if you want to see the full code you need to download $$anonymous$$y Assets linked in my question and search for the Player_Controller.cs.

Hope this will help :)

avatar image erlo68 · Feb 24, 2015 at 07:25 AM 0
Share

And i will definitely consider learning how to use a 3D-$$anonymous$$oddeling software ^^

But the main reason was to make animations that "construct the player" out of its parts when spawning and deconstruct him on death but in the way as if the connections between the parts will simply vanish on death and the parts can be thrown around individually, and i don't know if this will work if i make my Player as a "complete" structure.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Making a bubble level (not a game but work tool) 1 Answer

3D Character Controller slowing down the higher the slope angle (both up and down) 1 Answer

Problem with player movements 1 Answer

Unity how to make different enemy spawn one at a time 1 Answer

Distribute terrain in zones 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