Adding Any Amount Of Force Wont Move Gameobject!

Its self explanitory, any force even “1e+21” wont move this object

  1. Is Kinimatic Is Off
  2. Mass Is 950 (cant change for specifications)
  3. My Code Looks Ok
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Explode : MonoBehaviour
{
    public float fieldOfImpact;
    public float explosionForce;
    public GameObject[] explosion;
    public Transform[] explosionTransform;
    public Transform collisionSpot;
    public int life;
    public float expMagnitude;
 
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "car"){
            collisionSpot = collision.transform;
        Explosion();
        Destroy(gameObject);
        Destroy(explosion[0]);
        }
    }
 
    private void Explosion()
    {
        GameObject _explosion = Instantiate(explosion[0], collisionSpot.position, collisionSpot.rotation);
        Collider[] colliders = Physics.OverlapSphere(transform.position, fieldOfImpact);
        foreach (Collider target in colliders)
        {
            Rigidbody rb = target.GetComponent<Rigidbody>();
            if (rb != null)
            {
                rb.AddForce(Vector3.up*expMagnitude,ForceMode.VelocityChange);
                Debug.Log("Explosion");
            }
        }
        Destroy(_explosion, life);
    }
}

I Just Cant Figure It Out!

Also FYI I Do Get The "Explosion" Debug

Is there any other script on the object that you are trying to move that might be overriding the position on every frame?

Only other script is a car controller script. It doesn't mess with the y axis though and its disabled

2 Answers

2

I Just ENDED Up Rewriting The Entire Car Controller and now it works FLAWLESSY!

Is it possible that you set the drag value of your rigidbody to a value greater or equal to 50? If that’s the case your drag would 100% kill all momentum every physics frame. That’s because of the way how drag works which is a bit unintuitive. See my post over here.