playMaker

Author Topic: How to access camera properties?  (Read 2425 times)

amaranth

  • Full Member
  • ***
  • Posts: 172
    • View Profile
How to access camera properties?
« on: September 28, 2012, 04:56:39 PM »
I have a camera with a few properties I want to tweak, but I'm not sure how to do this. I tried saving the camera component as an object variable, but I don't see the camera in the object list. I'm not sure how to get the camera properties.

A few of the camera properties that I'm trying to access are:
-Clear Flags
-Background
-Culling Mask

Any ideas?

kiriri

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: How to access camera properties?
« Reply #1 on: September 29, 2012, 12:33:40 AM »
I don't think this is possible, since the object variables (such as camera info etc) have not been integrated. They are just there without doing a thing, afaik. In your case you might create a number of prefabs of the camera with different attribute and switch them if needed. I personally would create a prefab though, which has the fsm directly on the camera. That way, you can simply drag the actual camera component in as a set property action and once the object is instanced in the game, the FSM will no longer target the prefab, but the actual instance itself.
Best,
Sven

amaranth

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: How to access camera properties?
« Reply #2 on: September 29, 2012, 03:44:18 PM »
Figured that might be the case. I created an action to capture the background color, which was most important.

kiriri

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: How to access camera properties?
« Reply #3 on: October 08, 2012, 05:21:42 AM »
Sorry amaranth, it does work and here's the solution (different example but same principle):
http://hutonggames.com/playmakerforum/index.php?topic=2396.0
Best,
Sven

amaranth

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: How to access camera properties?
« Reply #4 on: October 08, 2012, 12:45:10 PM »
Sorry? This is awesome! Going to see if I can get my camera to show up with the info in your new post. :)