Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: TRUEfoe on June 02, 2016, 05:59:27 PM

Title: Making a Nerf Dart Stick to an Object
Post by: TRUEfoe on June 02, 2016, 05:59:27 PM
Hi guys, TRUEfoe here, brand new to Playmaker.  Working on a game that uses darts that I'm trying to make stick to certain objects.  Here's a short video of what I have so far,


I'm trying to figure out a better way to make the object stick to other objects on a random chance using Playmaker.  Right now I'm using "Is Kinematic" but that doesn't work on objects that move after getting shot.  Any ideas on what to do?
Title: Re: Making a Nerf Dart Stick to an Object
Post by: mdotstrange on June 02, 2016, 07:29:41 PM
I had to do this for a weapon on a current project-

Add a raycast or spherecast on the dart thats firing in its forward direction- use the cast to get the hitObject, hitPoint and hitNormal-

Parent the dart to the hitObject and use the hitPoint and hitNormal to attach and align it to where it hit on the surface of the object-

Instead of parenting you could also despawn/destroy the dart on impact after getting the variables you need- then use the hitPoint etc to spawn a new dart parented to the object on its surface-
Title: Re: Making a Nerf Dart Stick to an Object
Post by: TRUEfoe on June 02, 2016, 09:17:02 PM
Hiya, Thanks for the help! 

I was able to get the RayCast event to pick up correctly but wasn't sure about what to do with the parenting information to make it stick.  Which "Playmaker action" would you be able to set parent and also set the HitPoint and HitNormal?

Thanks in advance.