Search Unity

How to know the force on a rigidbody 2d?

Discussion in 'Scripting' started by NeoEtIchiro, Apr 5, 2021.

  1. NeoEtIchiro

    NeoEtIchiro

    Joined:
    Mar 7, 2021
    Posts:
    6
    Hello,
    do you know how to know the
    force is applicates to the character in a 2d scene?
    I want to cancel a jump in progress.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,740
    Force on any Rigidbody comes in two primary forms:

    1. the force(s) you apply in code

    2. the forces applied by collisions

    The former is trivial: it's your code, go find it.

    The latter is provided in the Collision objects given to you by Unity during collision message callbacks.

    Since you have provided absolutely nothing in the form of functional code, it's not possible to say anything more except:

    How to report your problem productively in the Unity3D forums:

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

    How to understand compiler and other errors and even fix them yourself:

    https://forum.unity.com/threads/ass...3-syntax-error-expected.1039702/#post-6730855

    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/
     
  3. NeoEtIchiro

    NeoEtIchiro

    Joined:
    Mar 7, 2021
    Posts:
    6
    Hello sorry for dont delete this post I've find the solution.