playMaker

Author Topic: Prefab Look At  (Read 2042 times)

grimmy

  • Junior Playmaker
  • **
  • Posts: 70
Prefab Look At
« on: February 14, 2014, 11:05:55 AM »
I have a prefab tree sprite which I always want to look at the main camera. The problem is that I can't assign my prefab 'Target Object' an object within the scene (ie the main camera). I can only choose from prefabs.

How do I make a my tree prefab always face the camera so I don't have to assign the target object again to every instance each time I place a new tree?

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: Prefab Look At
« Reply #1 on: February 14, 2014, 01:18:47 PM »
Use get current cam or get main cam (not sure how its called) in the inti of the tree script - put the cam in a local game object variable - use that variable as look at goal.

Or put the Cam (or what ever Object) in a Global Variable and use that instead in your prefab as look at target

cheers
peter