#CustomPhysicsSystemGroup

1 messages · Page 1 of 1 (latest)

nimble trout
#

How do i use CustomPhysicsSystemGroup?

I tried using like this but this system never updates:

public partial class AmbiencePhysicsGroup : CustomPhysicsSystemGroup
{
    public AmbiencePhysicsGroup() : base(1, false) { 

    }       
}


[UpdateInGroup(typeof(AmbiencePhysicsGroup))]
public partial class AmbiencePlayerSystem: SystemBase```

I want to check collisions on physics world 1
digital ravine
#

CustomPhysicsSystemGroup is for custom physic worlds is that what you're trying to setup?

#

-edit- whoops ok it seems like it is ignore me

nimble trout
#

There are no examples. Not even on git

nimble trout
digital ravine
#

there is somewhat of a sample actually in netcode

#

but i don't see anything special here over what you've done

nimble trout
#

I can`t see where they use it

#

VisualizationPhysicsSystemGroup has no references

digital ravine
#

they don't need to use it in this sample

#

they're just running the simulation separately for different entities

nimble trout
#

I think i found the problem

#

this: CustomPhysicsSystemGroup is a SystemBase and i don`t use it as an attribute but override OnUpdate on it

#

Makes sense?

#
public partial class AmbiencePhysicsGroup : CustomPhysicsSystemGroup
{
    public AmbiencePhysicsGroup() : base(1, false) { 

    }

    protected override void OnUpdate()
    {
        base.OnUpdate();

        Debug.Log("What");
    }
}```
like this
digital ravine
#

you weren't calling base.OnUpdate?

nimble trout
#

I was using it as an attribute for a system

#

Like this: [UpdateInGroup(typeof(AmbiencePhysicsGroup))] public partial class AmbiencePlayerSystem: SystemBase

digital ravine
#

what's wrong with that?

#

that's allowed

nimble trout
#

This system update was never called at all

digital ravine
#

it should be 🤔

#

i already looked at this code when you first posted this

#

the only thing that would stop OnUpdate running on this CustomPhysicsSystemGroup

#
        protected override void OnUpdate()
        {
            // Can't switch if the sim singleton is null
            if (SystemAPI.GetSingleton<SimulationSingleton>().Type == SimulationType.NoPhysics)
                return;```
#

is if you had physics turned off

nimble trout
#

Yes, i have physics turned off

#

I don`t need physics

digital ravine
#

well then what did you expect ^_^'

nimble trout
#

I want only to check collision

#

im using Rival Character Controller and it says to disable physics if dont need it

digital ravine
#

as far as i can tell CustomPhysicsSystemGroup is not going to work if you turn it off though

#

wait hang on

#

do you even need CustomPhysicsSystemGroupBase

#

if you aren't simulating?

#

because it does nothing

nimble trout
#

I want to check for colliders on another physics world / collision world only for triggering sounds

#

I have bounding boxes on physics world 1 and when they touch player it will swap ambience sound

digital ravine
nimble trout
#

No, idk how to check colliders outside physics world 0

#

it is always on physics world 0

#
    {
        /// <summary>   The physics world. </summary>
        public PhysicsWorld PhysicsWorld;

        /// <summary>   The PhysicsWorldIndex. </summary>
        public PhysicsWorldIndex PhysicsWorldIndex;```
#

PhysicsWorldSingleton has a PhysicsWorldIndex but there is no sample of getting PhysicsWorldSingleton othern than the first

#

Yeah, i think the problem is i have physics disabled

#

I will try to do it using AABB and primitive checks instead of collision world

#

I can enable physics for it to work but looks like overkill

#

Physics worlds are only for bodies and not for static geometry

#

@digital ravine do you recommend a better way of doing it? setup scene region for sound playing

lavish pelican
nimble trout
#

I don`t need static entities from main world