playMaker

Author Topic: Instantiate with Quaternion [SOLVED]  (Read 2908 times)

pjrm1470

  • Playmaker Newbie
  • *
  • Posts: 13
Instantiate with Quaternion [SOLVED]
« on: September 19, 2013, 12:01:09 PM »
Hi... As you guys maybe know from my topics, I'm making a tank game using Playmaker and I try to solve by my self almost all the problems that I had before come here.

To instantiate a Object i need the Vector3 Position and the Quaternion Rotation.
So i Add a "Create Object" Action, but the Rotation require a Vector3, not a Quaternion. When my turret is looking to the mouse position, the bullet instantiated starts with (0.0, 0.0, 0.0) on rotation.

There is an Action which is possible to instantiate the Forward position of my bullet to the angle which my turret is looking at? I already got the Quaternion rotarion but I didn't figure out how to do it.

Ps.: "Please, if my explanation is not clear enough, tell me! Then i try other way."
Best regards,
PJRM.
« Last Edit: September 19, 2013, 08:38:01 PM by pjrm1470 »

pjrm1470

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Instantiate with Quaternion
« Reply #1 on: September 19, 2013, 03:17:26 PM »
To be more simple:
How I build this line inside the PlayMaker:
Code: [Select]
GameObject GO = Instantiate(MyPrefab, transform.position, Quaternion.identity);Quaternion.identity    This is what i need! This would solve my problem although rotarion in "Create Object" Action is a Vector3.

Any ideas?
Best regards,
PJRM

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Instantiate with Quaternion
« Reply #2 on: September 19, 2013, 04:33:22 PM »
After Create Object use Set Rotation, which can take a Quaternion variable.

pjrm1470

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Instantiate with Quaternion
« Reply #3 on: September 19, 2013, 08:37:47 PM »
After Create Object use Set Rotation, which can take a Quaternion variable.
Strange thing a rotation being a vector3.
Well, topic solved. thank you so much!!!

best regards,
PJRM