Search Unity

Question Add Force to Rigidbody

Discussion in 'Getting Started' started by claize, Aug 4, 2021.

  1. claize

    claize

    Joined:
    Jul 5, 2021
    Posts:
    2
    Hello, The Cubes I am spawning are just slowly dropping to the bottom of the Screen. I want to add some force and Shoot em into view.

    upload_2021-8-4_10-32-7.png
    Error Notice:
    InvalidCastException: Specified cast is not valid.
    (wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
    UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation)

    p.s. I guess there is a better way to post code other than a screenshot, If you have advice on that as well im thankfull too.
     
    Last edited: Aug 4, 2021