[RELEASED] Physics Inspector

(Release Information - ACCEPTED)
__**Unity Asset Store - The Best Assets for Game Making

Physics Inspector is an editor extension that can help with getting precise values from things such as (Velocity and Impact Forces). Also is a visual aid in determining if your objects are moving faster than what you want them too.

Physics Inspector in this current version is an overall general help aid to get the most precise calculations.

Have you ever had a situation where you needed to know exactly how long you were in the air between jumping and need to know exactly how fast your character was moving to make a jump have to be done perfectly?

Or how about you want to make sure you object is balanced without tipping over. Physics Inspector actually calculates the rotations of your objects to put off warnings if your object has leaned over too much, thus falling over because of gravity.

Physics Inspector is the once and future all you need precise Physics Calculations system that you will ever need.

Currently Supported things
Realtime Velocity calculations.
Curves to help visually aid your velocities.
Single Impact Force.
Impacting Force between two objects.
Air Time (How long we were in the aid).
Color Coded bounding box to help visually aid how fast we want our objects to go.

(Only Show the next update, to plan accordingly)

Upcoming update

Vehicle Physics Calculations.
Bug Fixes if any are found.(I’ve tested over and over). Can’t find any bug fixes.


Video is 18 Minutes and 1 second.

Photos And Video.


2310160--155635--PhysicsInspector_ScriptSimple.png
__https://www.youtube.com/watch?v=7AL7Zw1VSCU__


Please if you have any questions or comments you’d like to state. Please do so, anything that can help me make this even better, I would greatly appreciate your time in your responses to make this even better.

Thank you!

@Kiwasi - Here’s the page buddy.

Physics Inspector version 1 just got approved! Check it out guys/gals!

Hi, N1warhead,

Sorry I’ve not checked the video as the network has gone sh*tty now.

I’m very interested to know that, are you making the Physx components (rigidbody, colliders) to work in edit-time?

As of currently right now the only thing that works during just the editor is balance checking (if you want balance checking).

I am sure however if you can make Forces and stuff working in Edit mode (I haven’t gotten that far yet), it will work assuming so because Balance checking works in edit mode.

I haven’t found a way to make Physics Forces work in edit mode because [ExecuteInEditMode] Doesn’t work with Physics, according to the Unity API it says this

I have tried moving things (to make the scene change, etc) and it won’t update.

So from what I can tell, if I can get that feature into the next big release of it I will definitely do that.
The only reason the balance checking works is because I have the editor Window constantly checking only (the selected Objects rotation). Which that there is just some basic math, if xyz is >= to somethign then put this warning label out so you know.

I do however have a document for instructions if you’d like them.
It goes over not just how to set it up, but exactly what everything is and does.

Here is the document if you are interested buddy.
(Had to upload it in .txt format as .rtf wasn’t accepted, so the text isn’t as pretty sorry man.)

2331657–157481–Doc.txt (6.49 KB)

Is this reading from physx values or calculating your own? If your own, how accurate is it to physx?

It’s directly reading from the Rigidbody.

Example -

(Rigidbody)
Drag = 1.
Mass = 1.
AngularDrag = 0.05f.

Alright.
Well, I make a C# Script and I put

public Rigidbody myRigid;
public float speed;

void FixedUpdate(){

myRigid.velocity = new Vector3(0, 0,speed );

}

Alright now what will happen is,
the Editor Extension just checks the actual speed of the object.
Doesn’t do any custom works, at least in this version of it.

So it’s just giving the the actual velocities of your object at the velocity they are currently moving at.

Example 2
I have same Rigidbody Settings.
However, same code above, lets say I’m moving 5 meteres per second (in force). But in reality it will be moreso 4 something meters per second. But what if we bump into another Physics object and start pushing it?
Our current velocity will then slow down and we can read it inside the Inspector that instead of going 4 something Units (In Velocity) per second, you’ll now figure out that we may now be moving 0.45235345 meters per second in real current velocity.

(Thoughs were all just examples - I’m not in the project to check the actual results right now).
However, long story short, it’s no custom calculations, just merely tracking the current forces I suppose you could say.
(Just don’t know the word for it) - as it’s not custom logic, just tracking current information about the object.

Now in my next major overhaul (didn’t want to start working on it until I knew if Asset Store would accept Physics Inspector).

Now that will be custom tailored logic that I will refuse to release until it is 100% accurate dealing with Vehicle Physics E.G. (RPM’s, mass effected on each wheel, and so on).

If you have any more questions please feel free to ask and I’ll try my best to answer them.
If I didn’t fully answer your question please feel free to try again, want to make sure everyone understands exactly what this is.

Just curious what kind of Physics Calculations everyone would like to see on the next update.
I’m thinking about doing Vehicles.

But would rather go for what’s more in demands.
If any of you would like to voice your opinions, please do so, so I can make Physics Inspector the greatest calculation system for all your Physics needs.

Hope to hear from y’all soon.
Thanks guys!

Anybody?

Truthfully, I’m not sure how I can use it, I do need to know about how much force to push, but just reading the current state from physx, is not that useful to me.

Well perhaps I explained wrong. You know how we programmers are haha, we know what it is, but explaining is the harder part.

Lets say I have my cube pushing at 5 meters per second.
It’s not going to say you’re moving 5 meters per second, it’s going to tell you the real speed at which it truly is moving.
If depending on the Drag, 10 I believe is the norm for Earth (at least for humans). The drag can be what you want regardless. It will determine the drag resistance against your object moving, so if (EXAMPLE - Not tested - not inside Unity right now). But if you have a drag of 10 and a force of 5 pushing your object, you are technically getting some rough real speed of 0.453464 or something like that, so it tells you the real true speed at which you are moving not the force you are pushing.

Likewise - if you have a drag of 10 and a force of 5 like above and end up (PUSHING) another object, it will then again - do some more math, instead of doing 0.453464 (real force) you will actually be doing less, depending on the amount of mass, you could plainly go 0 (stopped) or you can go even slower like 0.00004545250040 (just examples).

Long example short - it’s telling you the real actual force you are moving at, not hey I said go 5 units a second so say 5 units a second. It tells the real world value that of which you are currently doing precisely.

Also calculates impact forces as well!

Hi just purchased Physics Inspector. I have very basic question.

In my game I want to make some objects explode when they hit something else hard enough. So I could use the Last Impact Force/Last Collision Impact values that I see now in the PhysicsInspector. But how am I able to pull out these (Last Impact Force/Last Collision Impact) values from PhysicsInspector so I can use them in my scripts if statement to explode the gameobject it brakes?

Hello and thank you for the purchase buddy!

Very simple!

In your C# Script. make a float

I’ll make a generic script for you.

To access these variables (MAKE SURE THE - “_PhysicsObjectDebugger” is on each object you want to interact with!

Now here is the CUSTOM script.

using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour {

    float NameOfFloatYouWantToUse = 0.0f;

    //Dont Change this.
    public _PhysicsObjectDebugger debuggerScript;


    void Update(){
        NameOfFloatYouWantToUse = debuggerScript.totalForce;


        if(NameOfFloatYouWantToUse >= 25.0f){
            //Do your logic there.
            Debug.Log("WORKED");
        }
}
}

Now to make this work. Drag and drop this script on one of the two objects colliding, then drag and drop either or of the two objects into the slot. (Just tested and worked).

EDIT - Or you can might even try just referencing the totalForce float inside the object debugger script. That may even work.

1 Like

@Nadan - did that work buddy?
I got your like, but just want to verify it worked correctly for you.

Hi!

I just tried it and there is something strange. I made theNameOfFloatYouWantToUse variable public so I can see it in the inspector:

public float NameOfFloatYouWantToUse = 0.0f;

Then I dropped the gameobject in the game and in the inspector I see that the float value is 8.047388e-14

But the if statement is not working…

if(NameOfFloatYouWantToUse > 4f)
  {
  //Do your logic there.
  Debug.Log("WORKED");
  }

It’s not debugging. I quess that the float as a value is too huge for if statement or something?

How much mass do your objects have? I see a letter e in it.

Usually when you see an e-14 or whatever that means one of two things are (usually) going on. Either two much mass (Unity says to stay within 0 and 1) or they used too - not sure if that has changed. Or you have way to much force. This is a Unity thing and nothing to do with Physics Inspector. The best way to simulate lots of mass is to stick within 0 and 1 and amp the Drag to a higher number (Drag simulates Resistance). More Drag = more force to move it, but it’s more physically stable in Unity and doesn’t give off that e-14 stuff.