playMaker

Author Topic: Get Game Object's Material Count?  (Read 1570 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Get Game Object's Material Count?
« on: September 08, 2018, 11:42:52 AM »
I need to set the player game object's material to something different when too close to the camera. But the player might swap characters/models, and some will have many materials on them like skin, hair, etc.

I need to save all materials on a game object into a material array, in order, and I figured a "get material count" would be the best way to establish how many loops to do?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Game Object's Material Count?
« Reply #1 on: September 11, 2018, 02:15:26 AM »
Hi,

 Is that not the job of the LOD system?

Anyhow, I just did the action, it's now on the Ecosystem: getMaterials so you don't need to get them manually, it's just directly stored in an FsmArray.

Let me know if that's ok for you.

 Bye,

 Jean