See if you can work with something along the lines of:
- an actor with a collision volume detecting components that overlap it
- if the entering comp has an appropriate tag and simulates physics, we add it to an array
- when comps leave volume, we remove them from the array
- the actor applies force to all components that meet the abovementioned criteria
The spheres are unaffected here as they do not have the tag - that’d be one way to exclude things.
In a Cube, the gravity would change direction, this could point in any direction.
You could use the same method and:
Rather than towards the centre.
attached to the character or a projectile
Sure, why not:
This can be improved in a number of ways:
- linear and angular dampening could help
- force diminishing with distance for spherical volumes would make it seem more natural, surely
And there’s probably some kinks to iron out, as always. You’d also need to work a bit harder to get it affect player’s movement component.
Perhaps this can get you going, though.
Good luck!