playMaker

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

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
Raycast Hit Normal Info doesn't return the right rotation
« 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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3504
    • View Profile
    • jinxtergames
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #1 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.


Bipolar

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #2 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.



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, 07:41:17 AM by Bipolar »

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #3 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.


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: 13401
  • Official Playmaker Support
    • View Profile
Re: Raycast Hit Normal Info doesn't return the right rotation
« Reply #4 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