Search Unity

Bug Bug when colliding horizontally in Unity 3D

Discussion in 'Editor & General Support' started by LetsGoSalmon, Dec 26, 2022.

  1. LetsGoSalmon

    LetsGoSalmon

    Joined:
    Aug 17, 2021
    Posts:
    5
    post deleted
     
    Last edited: Dec 29, 2022
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,692
    Well there's your problem!

    Rigidbody and CharacterController are not compatible. They both fight for control of the Transform.

    If that's not what you meant, then we'd need a lot more information.

    My second random guess is you are manipulating a transform directly.

    With Physics (or Physics2D), never manipulate the Transform directly. If you manipulate the Transform directly, you are bypassing the physics system and you can reasonably expect glitching and missed collisions and other physics mayhem.

    Always use the .MovePosition() and .MoveRotation() methods on the Rigidbody (or Rigidbody2D) instance in order to move or rotate things. Doing this keeps the physics system informed about what is going on.

    https://forum.unity.com/threads/col...-unity-physic-rigidbody.1216875/#post-7763061

    https://forum.unity.com/threads/oncollisionenter2d-not-being-called.1266563/#post-8044121
     
  3. LetsGoSalmon

    LetsGoSalmon

    Joined:
    Aug 17, 2021
    Posts:
    5
    This is my Player Movement script
     

    Attached Files:

  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,692
    I have suggested many things to you to investigate and you simply did not respond except to mis-post a file full of source code instead of properly using code tags.

    The purpose of this forum is to assist people who are ready to learn by doing, and who are unafraid to get their hands dirty learning how to code, particularly in the context of Unity3D.

    This assumes you have at least written and studied some code and have run into some kind of issue.

    If you haven't even started yet, go check out some Youtube videos for whatever game design you have in mind. There are already many examples of the individual parts and concepts involved, as there is nothing truly new under the sun.

    If you just want someone to do it for you, you need go to one of these places:

    https://forum.unity.com/forums/commercial-job-offering.49/

    https://forum.unity.com/forums/non-commercial-collaboration.17/

    https://livehelp.unity.com/?keywords=&page=1&searchTypes=lessons

    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/

    You may edit your post above.
     
  5. LetsGoSalmon

    LetsGoSalmon

    Joined:
    Aug 17, 2021
    Posts:
    5
    Thanks, I'll try some other place.