playMaker

Author Topic: GameObject Visible In Camera Frustum  (Read 11309 times)

TrentSterling

  • Junior Playmaker
  • **
  • Posts: 89
  • Someday I'll make games!
    • My Blog
GameObject Visible In Camera Frustum
« on: September 21, 2014, 10:01:26 AM »


GameObject.renderer.isVisible doesn't work when an object casts dynamic shadows. This makes the GameObjectIsVisible action useless in any application with shadows enabled.

Here's a replacement action that test's if the object's renderer bounds are within the Main camera's frustum planes.



Based off a code snippet from here:
http://forum.unity3d.com/threads/is-target-in-view-frustum.86136/#post-626470

EDIT: I misspelled Frustum everywhere. It's not 'Frustrum' ha. Uploaded corrected class name and whatnot. God I feel dumb for that. Shoulda just called it viewport. Would have saved myself from the endless corrections here and my site and on youtube.
« Last Edit: September 22, 2014, 02:54:17 PM by TrentSterling »

rik

  • Full Member
  • ***
  • Posts: 246
Re: GameObject Visible In Camera Frustum
« Reply #1 on: December 07, 2014, 09:18:51 AM »
i was looking for the same

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: GameObject Visible In Camera Frustum
« Reply #2 on: October 13, 2015, 01:33:37 PM »
Nice one! Should go in the ecosystem imo.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: GameObject Visible In Camera Frustum
« Reply #3 on: October 16, 2015, 09:49:44 AM »
Hi,

 It's on the Ecosystem now



Bye,

 Jean

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: GameObject Visible In Camera Frustum
« Reply #4 on: October 17, 2015, 08:06:02 PM »
Very nice! Thanks!

moondust.games

  • Playmaker Newbie
  • *
  • Posts: 46
Re: GameObject Visible In Camera Frustum
« Reply #5 on: February 04, 2016, 06:57:07 AM »
Thanks for that!

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: GameObject Visible In Camera Frustum
« Reply #6 on: February 03, 2020, 05:34:26 PM »
Hey guys,

can some of the more experienced programmers take a look at this action, it's creating a lot of GC?
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: GameObject Visible In Camera Frustum
« Reply #7 on: February 04, 2020, 05:42:30 AM »
Hi,

 This action is on the Ecosystem (IsVisibleInCameraFrustrum). I just updated it to remove as much GC as possible, it will be even better starting 2017.3 as Unity made a GC free version of the frustrum planes api command.

So update the action from the ecosystem and use that one instead of the one attached to the first post of this thread.

 Let me know if you see an improvement.

Bye,

 Jean

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: GameObject Visible In Camera Frustum
« Reply #8 on: February 05, 2020, 05:39:06 AM »
Thanks Jean, works great, 0.0kb of garbage :)
Available for Playmaker work

Silicon Power

  • Full Member
  • ***
  • Posts: 186
Re: GameObject Visible In Camera Frustum
« Reply #9 on: February 03, 2022, 07:42:18 AM »


GameObject.renderer.isVisible doesn't work when an object casts dynamic shadows. This makes the GameObjectIsVisible action useless in any application with shadows enabled.

Here's a replacement action that test's if the object's renderer bounds are within the Main camera's frustum planes.



Based off a code snippet from here:
http://forum.unity3d.com/threads/is-target-in-view-frustum.86136/#post-626470

EDIT: I misspelled Frustum everywhere. It's not 'Frustrum' ha. Uploaded corrected class name and whatnot. God I feel dumb for that. Shoulda just called it viewport. Would have saved myself from the endless corrections here and my site and on youtube.

Hi thank you. What about objects behind a wall? can it still be seen?