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 deepthinker · Jul 11, 2012 at 07:27 AM · movementphysicsplayertranslate

Which is better for player movement: physics or translation

I have a player object that moves forwards as well as sideways. It moves in a narrow x range sideways depending on user input whereas in the forward direction it moves automatically without input.

I am seeking whether applying forces is the right way to move it or should i move it using transform.translate?

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 Bovine · Jul 11, 2012 at 07:59 AM 0
Share

It depends on your game - we have a tile-based RPG game and we used to move the player (and all NPCs) using physics moving over a terrain but we found that this was overkill, especially once we had moved to flat environments. We removed all of this and created animations for the movement tile to tile, using animation events to jump the player to the new tile when the animation has completed.

In-between these two methods we used coroutines to Lerp the player from one position tot the next, but I felt that animations would be cheaper and that player and NPC positions would be easier and cheaper as we are running on mobile. If you are targeting the desktop it might not be as much of an issue for you.

it all depends on your game, your platform and the freedom of movement you need to allow your player.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by DisruptionGames · Jul 11, 2012 at 08:26 AM

It all really depends on what you are looking to achieve.

I find for less Physics/Intense Realism based games. You would want to use Translation. Translation also is a bit easier to compile from looking at it (Seeing what is happening) if you take the time to get it. Physics based can get a bit glitchy if its not done perfect/right. But physics does add the simple ability to add outside forces to the player.

Overall: I use a bit more of Translation just because its a bit simpler to work with and isn't labor intensive on the system. As far as Pre-Made Controllers go, I would say its about 50/50 down the middle. But I have seen more noble Translation based Controllers than Physics Based (Rigidbody).

Its kind of hard to judge what you mean by the context of translation and physics. So I went on a tangent and assumed Physics meant Rigidbody and Translation meant Character Controller.

Comment
Add comment · Show 5 · 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 Bovine · Jul 11, 2012 at 08:36 AM 0
Share

I think he means moving the GameObject using this.transform.Translate().

But it's worth making a distinction that a CharacterController is designed for very specific movement and in itself, is not affected by physics, but character controllers are a special collider of sorts that will respect the colliders in your game and move along them.

A CharacterController is not affected by rigid bodies, but they can be used together, though getting character like behaviour with a rigid body based controller is difficult.

The Unity docs discuss rigid bodies and character controllers here:

http://docs.unity3d.com/Documentation/Components/comp-DynamicsGroup.html

avatar image deepthinker · Jul 11, 2012 at 09:30 AM 0
Share

Yes I mean this.transform.translate().

I am using forces on a rigidbody on the player to move now, and the issue is controls are not crisp enough. In sideways motion, when the player receives input to reverse movement direction, it takes some time to do so.

Is there some way to make the player more responsive while using physics, or would translate be better?

PS I am not using character controllers

avatar image DisruptionGames · Jul 11, 2012 at 09:33 AM 1
Share

Just using a native character controller without Rigidbody forces is quite easy. If you are looking for a crisp feel to it you can base movement with move directions and based off of Horizontal and Vertical Input (WASD/Arrow $$anonymous$$eys) and add a higher gravity to them in the Input $$anonymous$$anager.

avatar image Bovine · Jul 11, 2012 at 09:34 AM 1
Share

So CharacterControllers are a convenience component, so I would first ask whether you COULD use them. The problems you're experiencing are the difficult issues mentioned in the link above and I cannot help with that but I would as yourself if you need your player to be affected by other forces - could the CharacterController work for you?

avatar image deepthinker · Jul 11, 2012 at 09:46 AM 0
Share

translate works better. a character controller could work but i want to apply forces to it as well to simulate floating of the player.

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

6 People are following this question.

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

Related Questions

Strange behavior with the Unity car? 0 Answers

Detecting Touch on moving Object - Help Needed! 1 Answer

Non slippery movement 1 Answer

How do you calculate DeltaX and DeltaZ for a character? 1 Answer

Glitchy Movement on Slopes using Character Controller 1 Answer


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