Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Thomas Pasieka on December 08, 2014, 09:09:16 AM

Title: [SOLVED] Orienting Plane/Decal
Post by: Thomas Pasieka on December 08, 2014, 09:09:16 AM
Hey there guys,

I created a little FSM which uses Raycast to shoot a bullet and create a decal/texture on impact (Left Mouse Button will trigger the shooting). So far so good. Everything works as expected (Thanks Lane).

My current problem is that the Bullet Decal (a texture on a plane mesh) doesn't orient itself properly to the normal direction of the meshes. Currently I stored two variables. hitNormal and hitPoint (Vector3).

I can't figure out what I need to do in order for the plane to orient properly. Any help would be appreciated.

Thomas P.
Title: Re: Orienting Plane/Decal
Post by: Lane on December 08, 2014, 10:18:04 AM
Use Get Quaternion From Rotation.

From would be something like 0,1,0 and the Direction is the hitNormal.

The result is a quaternion you apply using Set Rotation.
Title: Re: Orienting Plane/Decal
Post by: Thomas Pasieka on December 08, 2014, 12:25:42 PM
Thanks for your help on that matter mate ;)