playMaker

Author Topic: Prefab problem[Solved]  (Read 2419 times)

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Prefab problem[Solved]
« on: January 08, 2015, 10:30:24 PM »
Hi,

I have a working character that moves using the axis vector, controller simple move & smooth look at direction. Then i have a camera with get/set position and itween rotate update. Everything is working fine.

After i put it into a prefab, the character movement or the direction is not working right.

Is there anything i need to know about working with playmaker and prefab?

« Last Edit: January 09, 2015, 10:44:46 PM by iikii »
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: Prefab problem
« Reply #1 on: January 09, 2015, 02:15:55 AM »
If your prefab as any references to scene objects in the FSMs that tends to not work and forget the assignments. Just be sure all your FSMs use non scene objects or have logic to find the corresponding object upon creation.

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: Prefab problem
« Reply #2 on: January 09, 2015, 03:32:25 AM »
Sorry i dont quite understand because i am new to unity and playmaker.

Do you have any examples or file so that i can better understand it.
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

richardh

  • Junior Playmaker
  • **
  • Posts: 97
Re: Prefab problem
« Reply #3 on: January 09, 2015, 06:06:00 AM »
If your logic FSM has smooth look at then the FSM has been told to look at 'something' in your FSM. When you create the prefab then the prefab looses the connection to that 'something' it's supposed to look at since they are two separate objects.

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: Prefab problem
« Reply #4 on: January 09, 2015, 10:44:34 PM »
oh..i finally solve it.

My character has a get axis vector and cannot find the camera to be relative to. I use find gameobject action to find the main camera and store the result to be use for my axis vector.

thanks for the answers!
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio