Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 sacredgeometry · Oct 09, 2012 at 04:05 PM · movementphysicscolliderplayercontroller

Movement script breaks colliders

Hi I augmented the character controller with this(in another c# file) It adds vertical movement but when my player object hits a collider whilst moving in this way it just travels straight through. Can anyone tell me why this is please?

 void playerHoverMovement(){
         if(Input.GetAxis("upDown") >= 0){
             this.transform.Translate(new Vector3(0,Input.GetAxis("upDown"),0)
                 * Time.deltaTime
                 * verticalMoveSpeed
                 * OceanBox.isBelowOceanFloor(oceanBox.playerTransform),
                 Space.World);
         }
         if(Input.GetAxis("downUp") >= 0 /*&& !isAtLevelBounds()*/){
             this.transform.Translate(new Vector3(0,-Input.GetAxis("downUp"),0)
                 * Time.deltaTime
                 * verticalMoveSpeed
                 * OceanBox.isAboveOceanFloor(oceanBox.playerTransform),
                 Space.World);
         }
     }
Comment
Add comment · Show 6
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 Mander · Oct 09, 2012 at 05:15 PM 0
Share

use transform.TransformDirection ins$$anonymous$$d of translate. give it a try

avatar image sacredgeometry · Oct 09, 2012 at 05:52 PM 0
Share

Can you please give me an example of how to implement that as it does nothing by swapping out the commands :(

avatar image Mander · Oct 09, 2012 at 05:54 PM 1
Share

http://docs.unity3d.com/Documentation/ScriptReference/CharacterController.$$anonymous$$ove.html

check the example there in the doc

avatar image sacredgeometry · Oct 09, 2012 at 06:02 PM 0
Share

Whoops misread sorry I will have a look

avatar image Mander · Oct 09, 2012 at 06:06 PM 0
Share

controller.$$anonymous$$ove is the one that moves the char in the example. move works with a vector3 which is represented as the variable moveDirection. that gets the input axes

Show more comments

1 Reply

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

Answer by Mander · Oct 09, 2012 at 06:08 PM

CCexample

check the example there in the doc to use the CharacterController

controller.Move is the one that moves the char in the example. move works with a vector3 which is represented as the variable moveDirection. that gets the input axes

Comment
Add comment · Show 1 · 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 sacredgeometry · Oct 09, 2012 at 06:13 PM 0
Share

Thanks Again

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

10 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

Related Questions

How to limit the forces applied to an object to just forward, left, and right? 0 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

A simple solution for constant rigidbody movement without changing and clamping velocity directly 2 Answers

Every time my character hits or touches the walls he gets stuck or acts as if the object the character hit was a magnet. 0 Answers

Non slippery movement 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