Playmaker Forum

Playmaker Help & Tips => Playmaker Help => Topic started by: Bipolar on September 27, 2018, 04:36:18 AM

Title: Raycast Hit Normal Info doesn't return the right rotation
Post by: Bipolar on September 27, 2018, 04:36:18 AM
Hi, I recently bought a decal system.

I made a FSM which should place these decals based on the point and the normal angle. Raycast hit point works, but the decal doesn't set the right rotation compared to the hitten wall.

So the decal spawn correctly only on the floor.
I used Raycast Info to get Point and Normal, then Create Object with position and rotation to point and normal, but nothing...

Some help?
Do you need some screen too?
Title: Re: Raycast Hit Normal Info doesn't return the right rotation
Post by: djaydino on September 27, 2018, 07:34:15 AM
Hi.
i just very recently made a video for bullet holes, maybe it can help you.

The key is the Quaternion look rotation


But i will redo the video as i forgot to show how to build the prefab or use an offset.

if you need the offset you can add these 2 actions to the 'Spawn Bullet Hole state to have it a bit in front of the wall.

(https://i.imgur.com/flhsQREl.png)
Title: Re: Raycast Hit Normal Info doesn't return the right rotation
Post by: Bipolar on September 27, 2018, 07:37:38 AM
Hi.
i just very recently made a video for bullet holes, maybe it can help you.

The key is the Quaternion look rotation


But i will redo the video as i forgot to show how to build the prefab or use an offset.

if you need the offset you can add these 2 actions to the 'Spawn Bullet Hole state to have it a bit in front of the wall.

(https://i.imgur.com/flhsQREl.png)

Cool man! I'm trying now! :). I'll let you know.
The offset is provided by EasyDecal, so I don't think to have problems.

Title: Re: Raycast Hit Normal Info doesn't return the right rotation
Post by: Bipolar on September 27, 2018, 09:00:07 AM
Hi.
i just very recently made a video for bullet holes, maybe it can help you.

The key is the Quaternion look rotation


But i will redo the video as i forgot to show how to build the prefab or use an offset.

if you need the offset you can add these 2 actions to the 'Spawn Bullet Hole state to have it a bit in front of the wall.

(https://i.imgur.com/flhsQREl.png)
Ok, I tried.

It works 50\50: Sometimes it make mistakes with rotation, so the decal is placed in the wrong angle.

I'm not using pools, I don't need it. I have already a decal system.

Title: Re: Raycast Hit Normal Info doesn't return the right rotation
Post by: jeanfabre on October 11, 2018, 01:51:14 AM
Hi,

 The hit normal can not give you the up vector for you to place your decal properly, you will need to define manually the up vector for it's placement.

 Bye,

 Jean