playMaker

Author Topic: Raycast Hit Normal  (Read 2301 times)

greg

  • Junior Playmaker
  • **
  • Posts: 68
    • View Profile
Raycast Hit Normal
« on: March 28, 2013, 12:07:52 PM »
How do i get this to work? I'm spawning some smokeFX at the hitpoint and want it to rotate to the hit normal.

The item spawned at the hitpoint of the raycast (bullet smoke) always spawns with rotation: 0, 0.999999, 0

I tried the usual way where i create object at the hitPoint, and in the rotation field i use the hitNormal.
I tried spawning the object, then using "set rotation" afterward.

There was another thread here: http://hutonggames.com/playmakerforum/index.php?topic=3296.msg15063#msg15063

where Red provided a custom code which was basically "set rotation", but this hasn't worked for me.

Whats going on here?

FractalCore

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 98
    • View Profile
Re: Raycast Hit Normal
« Reply #1 on: March 30, 2013, 02:47:38 AM »
I ran into this as well. Managed to get it working. http://hutonggames.com/playmakerforum/index.php?topic=725.msg3706#msg3706

The problem is that a normal and a rotation are different things. And I've never needed to get normal info from a raycast. The Get Raycast Hit Info should have a Rotation instead of, or as well as the Normal option.

greg

  • Junior Playmaker
  • **
  • Posts: 68
    • View Profile
Re: Raycast Hit Normal
« Reply #2 on: March 30, 2013, 06:19:10 AM »
Edit:

Solution
- Add "hit_location" and "hit_normal" together (vector3 operator)
- Point your "bullet_fx" towards the result (look at)


Thankyou!
« Last Edit: March 30, 2013, 11:19:35 AM by greg »