playMaker

Author Topic: calculate bounds  (Read 2938 times)

kiriri

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
calculate bounds
« on: November 24, 2012, 05:45:07 AM »
Hey,
I'm not sure if there's not already some way to do this with playMaker, but this action lets you get the bounds of an object. To understand what bounds are, add a box collider to any gameObject in your scene. Those are the dimensions of the local bounding box, also call the rendered bounds.
So if your actual mesh changes ingame (like if you're using a text system like toolkit2D or the like) you can call this action and then set the collider size to the vector3 value this action returns.

So the global bounds is like the local bounds, only that it does not rotate. It will calculate itself from the most right/left up/down forwards/backwards points of your mesh and it will always do so while being aligned to the axis.
More visual, if you have one rotated box in the scene, then the global bounding box will give you the size an unrotated box needs to completely surrond the rotated box.

All in all this can be used for all kinds of things, including manual collisions and the like.

Cheers,
Sven
Best,
Sven

upOwlNight

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
Re: calculate bounds
« Reply #1 on: January 28, 2016, 05:48:08 AM »
wow, this is exactly what I need. Any chance you can update it to playmaker 1.8, unity 5? I'll put this in the action request page as well.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: calculate bounds
« Reply #2 on: February 01, 2016, 04:56:04 AM »
Hi,

 In what way it doesn't work now? It seems fine as a custom action.

Bye,

 Jean

upOwlNight

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
Re: calculate bounds
« Reply #3 on: February 01, 2016, 02:24:15 PM »
well first I get a popup that tells me I need to update my APIs because the ones the script use are obsolete .

I went ahead and did it because I really wanted this action, and after I did I lost my new playmaker functionality of creating new variables from the drop down. This functionality: disappeared after I clicked "go ahead I've made a backup."

I'm about to try the link to the action in ecosystem that you sent me in another thread. I've never heard of ecosystem until then.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: calculate bounds
« Reply #4 on: February 02, 2016, 08:21:47 AM »
Hi,

 I saw on the other post you found a solution, so let's not use this one then.

 Bye,

 Jean