playMaker

Author Topic: Raycast Hit Normal Info doesn't return the right rotation  (Read 2185 times)

Bipolar

  • Junior Playmaker
  • **
  • Posts: 68
Raycast Hit Normal Info doesn't return the right rotation
« on: September 27, 2018, 07: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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #1 on: September 27, 2018, 10: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.


Bipolar

  • Junior Playmaker
  • **
  • Posts: 68
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #2 on: September 27, 2018, 10: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.



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.

« Last Edit: September 27, 2018, 10:41:17 AM by Bipolar »

Bipolar

  • Junior Playmaker
  • **
  • Posts: 68
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #3 on: September 27, 2018, 12:00:07 PM »
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.


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.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #4 on: October 11, 2018, 04: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