playMaker

Author Topic: How to get all objects inside a trigger?  (Read 761 times)

Silicon Power

  • Full Member
  • ***
  • Posts: 186
How to get all objects inside a trigger?
« on: September 21, 2021, 06:26:24 PM »
Hi. I want to create an optimization tool with playmaker so is there a way to get all objects inside a trigger? I want to deactive all objects behind camera and reactive those in the front of camera.
« Last Edit: September 22, 2021, 05:39:35 AM by Silicon Power »

drown

  • Junior Playmaker
  • **
  • Posts: 58
Re: How to get all objects inside a trigger?
« Reply #1 on: September 27, 2021, 02:59:58 PM »
I really do not think that wiring a proper optimization system in Playmaker is a particular great idea - why not use Unity's inbuilt culling?

Simply de- and reactivating objects via "Activate GameObject" will actually give you performance drops.

To give you a possible solution for getting all objects inside a trigger :

when an objects enters a trigger store it in a specific array. when it leaves the trigger delete it from that array. When the culling / optimization is called iterate over all objects inside that array until there are none left.

Again, I do not think this will give you performance optimization.