playMaker

Author Topic: How do I make an object to "look at" a Prefab(Clone)?  (Read 2283 times)

queture

  • Playmaker Newbie
  • *
  • Posts: 10
How do I make an object to "look at" a Prefab(Clone)?
« on: February 22, 2015, 03:36:09 PM »
Hi there, ;)

Ive been searching for answers to make an object to track a cloned prefab like a missle. I did tried to set vector3 of the original prefab and kinda lost the steps after that. Im noob to unity and playmaker and im not code trained :-[

Thank you very much in advance. ;D

Q

queture

  • Playmaker Newbie
  • *
  • Posts: 10
Re: How do I make an object to "look at" a Prefab(Clone)?
« Reply #1 on: February 23, 2015, 01:19:31 AM »
...or any advise on how should i get my turret to track a flying missile(clone)?

Thank you.

Q

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do I make an object to "look at" a Prefab(Clone)?
« Reply #2 on: February 23, 2015, 01:22:47 AM »
Hi,

 One easy way to get you up and running would be to use a smoothLookAt action.

 the smoothLookAt will allow to define some "delay" in the way the turret aims at the missile.

But you may have issued before this already. Are you able to get a reference of the missile in your turret fsm?

 Bye,

 Jean

queture

  • Playmaker Newbie
  • *
  • Posts: 10
Re: How do I make an object to "look at" a Prefab(Clone)?
« Reply #3 on: February 23, 2015, 07:40:44 AM »
Do you mean reference by doing this?

"create a copy of that missile prefab object into scene?"

yes, dat way, the turret does stick it's nose onto the missile in the scene but it ignores the rest of the clones when fired upon.

ok, im totally lost in unity after searching wat u mean by reference.
so sorry.

EDITED: Think I will continue my search for further alternative ways.

thanks for the time.
« Last Edit: February 23, 2015, 03:38:12 PM by queture »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do I make an object to "look at" a Prefab(Clone)?
« Reply #4 on: February 24, 2015, 07:52:35 AM »
Hi,

By reference, I mean are you able to store the missile GameObject  prefab in a FsmGameObject variable in your fsm that needs to look at it?

since it's a prefab, it can't only be done at runtime, hence what I am asking, because it requires you to implement this in your logic, that when you create the missile prefab, you store the instance you just created somehow within PlayMaker for other fsm to use it.


 
 Bye,

 Jean