Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question NaN Values and Strange PhysicsVelocity Behaviour

Discussion in 'Physics for ECS' started by Santonian, Oct 28, 2022.

  1. Santonian

    Santonian

    Joined:
    Sep 23, 2020
    Posts:
    20
    Hi everybody,

    I just started using physics in my dots project. The reason is, that I want to do area raycasts and as far as I understood, I need a physics body component for that on my entity.
    anyhow, what you can see on this screen is my simple setup. The gray prototype tiles on the floor are all entities with a physic shape, The gray tiles on top of the floor are just an entity without any physic components. The yellow wall thing has a physic shape and a dynamic physic body. What is strange here is, that the numbers of Physic Velocity are jumping around. I should have taken a video, but they are constantly changing to totally different values. That does not look correct, but at least I can see my Wall Entity in the World.

    StrangePhysicVelocity.png

    What is even more strange, when I instantiate more walls into the world, most (if not all of them) don't get rendered into the world at all, and this is what I can see in the inspector. A lot of NaN on different Componenten and the Physics Velocity has an ever-decreasing Linear Y Value

    StrangePhysicVelocity-2.png

    Aside from the collision Filter, I did not assign any values to the physic collider and the physic body. I just used the default values. These are the Shape and Body of my prefab I instantiate my Entities from prefab-physiccomponents.png

    I am using Entities 0.51.1-preview.21
    Unity Physics 0.51.1-preview-21

    and Unity 2021.3.11

    When I use static physic Body, everything is rendered fine, but I can not hit them with my area raycast.

    Can anyone point me in the right direction on how to fix this problem?

    help is greatly appreciated

    cheers
    Reinhard