playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - beowulfkaine

Pages: [1] 2 3
1
Playmaker Help / Launching object with force?
« on: September 14, 2017, 12:45:08 PM »
Hello, hopefully, someone may be able to help me.

I have an animation of a creature picking up a rock and throwing it.  I'm having a hard time trying to figure out the mechanics.  Is there a simple way for an object to be created in his and then at a certain frame have it launch based on the direction it was thrown?

2
Playmaker Help / Re: Ragdoll Workflow?
« on: July 29, 2017, 05:06:58 PM »
I'm afraid I have no idea how to even contemplate on how to accomplish that

3
Playmaker Help / Re: Ragdoll Workflow?
« on: July 29, 2017, 09:10:05 AM »
Hello tcmeric! Yes, I did try to follow along with it, but for some reason, I could not get it to work as you were showing in the video.  I do have that asset and I love it for many of its cool features, however, my application is a bit different.  As you remember I'm in a VR situation in which I am using physical objects, in my particular case, the bow and arrow from the steamVRr interactable object scene.

It uses a physical arrow with a collider that fire off the bow when released.  It does not use a raycast, which is where I had the roadblock.  Your video, which was well appreciated as are all your informative videos you make, didn't cover anything that would work with physical impacts.

I wrote the author and he told me this:

About rocket feature its like this:
1- start ragdoll
2- pick a bodypart you with to move
3- apply velocity upwards to that bodypart

Heres little code: 
     
 m_Ragdoll.startRagdoll();
RagdollManager.BodyPartInfo bpInfo = m_Player.ragdoll.getBodyPartInfo(9);
bpInfo.extraForce = Vector3.up * 4;


However, I am not a coder, hence why I use playmaker.  I've tried to monkey with that bit of code to no avail and got frustrated after a week of trying.

My application seems almost too simple, I wish to use the hit reaction on enemies, the arrows attach to the body part (which I finally figured out yesterday with colliders and physics materials) and most importantly, the Rocket feature, I love that, it makes me laugh so much and I can create so many funny death scenes with it.

I didn't keep bothering you about this because you've probably really busy with stuff and I didn't want to be a burden. I like learning things and at 40'ish that's pretty easy to do, especially with my background.  I wish I had more time to study c#, but it's hard to grasp it and there are not many videos on it that are ELI5.

I have really gotten the fundamentals of playmaker, which honestly, is better than sliced bread for me. I'm still learning all the actions, Array is one I keep thinking would help me somehow but I have absolutely no idea how to use it and I've tried to wrap my head around it as to what I can use it for.

So in layman's terms:

Set FLOAT (local variable: Health = 100) I got the Int and floats down pretty good thanks to you.
Arrow on hit (body part enable hit reaction on body part with force) attach to body part
If body part attach (optional: play animation and particle effect)
Add INT: -50 (Or whatever number) negative number
Compare FLOAT to Variable
If FLOAT is <0 then Event (this one I got pretty good)

Rinse and Repeat as needed

With hit manager my intent when I bought it was to be able to use all those effects (rocket launch, bubble capture and rise,Mine exploder and then the harpoon) but all attached to an arrow which uses a physical Collider.

I've also been trying to figure out a way to explode the characters that isn't cpu intensive as many characters would explode at once at one point.  I tried Mesh Exploder, Exploder, Mesh Exploder FX and my favorite DestroyIT.  Only two work with skinned meshes as it turns out.  I'm making a lot of people happy buying assets I can tell you that.

What would be ideal is it I could previously fracture the skinned meshes and have them be replaced when death occurs use force to knock back the fragments on what was hit if a ragdoll is not being used like this:



Scott Pilgrim, the greatest movie ever made BTW.

But that's whole other can of worms.

4
Playmaker Help / Ragdoll Workflow?
« on: July 29, 2017, 01:24:10 AM »
Looking everywhere and I can't find it.  Simple question for some, essentially I  have a character that has a ragdoll prefab as well. I want to know what the step by step workflow is to go from his mechanism animation to a ragdoll state? Is it possible to get the force hitting the object to be applied to the ragdoll as well throwing it in the air? I appreciate your help!

Thanks in advance!

5
Hi,
It is not that script :)
Maybe there is a script called "Interactable"
or look for scripts on the object (the one you talked about in the 1st post)

here is one actually called "Interactable"

Code: [Select]
/======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: This object will get hover events and can be attached to the hands
//
//=============================================================================

using UnityEngine;
using UnityEngine.Events;
using System.Collections;

namespace Valve.VR.InteractionSystem
{
//-------------------------------------------------------------------------
public class Interactable : MonoBehaviour
{
public delegate void OnAttachedToHandDelegate( Hand hand );
public delegate void OnDetachedFromHandDelegate( Hand hand );

[HideInInspector]
public event OnAttachedToHandDelegate onAttachedToHand;
[HideInInspector]
public event OnDetachedFromHandDelegate onDetachedFromHand;

//-------------------------------------------------
private void OnAttachedToHand( Hand hand )
{
if ( onAttachedToHand != null )
{
onAttachedToHand.Invoke( hand );
}
}


//-------------------------------------------------
private void OnDetachedFromHand( Hand hand )
{
if ( onDetachedFromHand != null )
{
onDetachedFromHand.Invoke( hand );
}
}
}
}

6
hi,
i think it is triggered from another script like for example :
Code: [Select]
private void OnHandHoverBegin( Hand hand )
Are you trying to get this script to work with your project or are you trying to remake this with Playmaker?

This script is from the SteamVR interactable demo scene.  It is the longbow part specifically. And in answer to your question , I'm definetly not trying to remake this script, I have no C# experience. I'm essentially trying to get it to work with playmaker.  My thought process is that there is some kind of method that is called by which I know how to do in playmaker with set property (i think)

here is the script I think you were talking about:

Code: [Select]
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: The object attached to the player's hand that spawns and fires the
// arrow
//
//=============================================================================

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace Valve.VR.InteractionSystem
{
//-------------------------------------------------------------------------
public class ArrowHand : MonoBehaviour
{
private Hand hand;
private Longbow bow;

private GameObject currentArrow;
public GameObject arrowPrefab;

public Transform arrowNockTransform;

public float nockDistance = 0.1f;
public float lerpCompleteDistance = 0.08f;
public float rotationLerpThreshold = 0.15f;
public float positionLerpThreshold = 0.15f;

private bool allowArrowSpawn = true;
private bool nocked;

private bool inNockRange = false;
private bool arrowLerpComplete = false;

public SoundPlayOneshot arrowSpawnSound;

private AllowTeleportWhileAttachedToHand allowTeleport = null;

public int maxArrowCount = 10;
private List<GameObject> arrowList;


//-------------------------------------------------
void Awake()
{
allowTeleport = GetComponent<AllowTeleportWhileAttachedToHand>();
allowTeleport.teleportAllowed = true;
allowTeleport.overrideHoverLock = false;

arrowList = new List<GameObject>();
}


//-------------------------------------------------
private void OnAttachedToHand( Hand attachedHand )
{
hand = attachedHand;
FindBow();
}


//-------------------------------------------------
private GameObject InstantiateArrow()
{
GameObject arrow = Instantiate( arrowPrefab, arrowNockTransform.position, arrowNockTransform.rotation ) as GameObject;
arrow.name = "Bow Arrow";
arrow.transform.parent = arrowNockTransform;
Util.ResetTransform( arrow.transform );

arrowList.Add( arrow );

while ( arrowList.Count > maxArrowCount )
{
GameObject oldArrow = arrowList[0];
arrowList.RemoveAt( 0 );
if ( oldArrow )
{
Destroy( oldArrow );
}
}

return arrow;
}


//-------------------------------------------------
private void HandAttachedUpdate( Hand hand )
{
if ( bow == null )
{
FindBow();
}

if ( bow == null )
{
return;
}

if ( allowArrowSpawn && ( currentArrow == null ) ) // If we're allowed to have an active arrow in hand but don't yet, spawn one
{
currentArrow = InstantiateArrow();
arrowSpawnSound.Play();
}

float distanceToNockPosition = Vector3.Distance( transform.parent.position, bow.nockTransform.position );

// If there's an arrow spawned in the hand and it's not nocked yet
if ( !nocked )
{
// If we're close enough to nock position that we want to start arrow rotation lerp, do so
if ( distanceToNockPosition < rotationLerpThreshold )
{
float lerp = Util.RemapNumber( distanceToNockPosition, rotationLerpThreshold, lerpCompleteDistance, 0, 1 );

arrowNockTransform.rotation = Quaternion.Lerp( arrowNockTransform.parent.rotation, bow.nockRestTransform.rotation, lerp );
}
else // Not close enough for rotation lerp, reset rotation
{
arrowNockTransform.localRotation = Quaternion.identity;
}

// If we're close enough to the nock position that we want to start arrow position lerp, do so
if ( distanceToNockPosition < positionLerpThreshold )
{
float posLerp = Util.RemapNumber( distanceToNockPosition, positionLerpThreshold, lerpCompleteDistance, 0, 1 );

posLerp = Mathf.Clamp( posLerp, 0f, 1f );

arrowNockTransform.position = Vector3.Lerp( arrowNockTransform.parent.position, bow.nockRestTransform.position, posLerp );
}
else // Not close enough for position lerp, reset position
{
arrowNockTransform.position = arrowNockTransform.parent.position;
}


// Give a haptic tick when lerp is visually complete
if ( distanceToNockPosition < lerpCompleteDistance )
{
if ( !arrowLerpComplete )
{
arrowLerpComplete = true;
hand.controller.TriggerHapticPulse( 500 );
}
}
else
{
if ( arrowLerpComplete )
{
arrowLerpComplete = false;
}
}

// Allow nocking the arrow when controller is close enough
if ( distanceToNockPosition < nockDistance )
{
if ( !inNockRange )
{
inNockRange = true;
bow.ArrowInPosition();
}
}
else
{
if ( inNockRange )
{
inNockRange = false;
}
}

// If arrow is close enough to the nock position and we're pressing the trigger, and we're not nocked yet, Nock
if ( ( distanceToNockPosition < nockDistance ) && hand.controller.GetPress( SteamVR_Controller.ButtonMask.Trigger ) && !nocked )
{
if ( currentArrow == null )
{
currentArrow = InstantiateArrow();
}

nocked = true;
bow.StartNock( this );
hand.HoverLock( GetComponent<Interactable>() );
allowTeleport.teleportAllowed = false;
currentArrow.transform.parent = bow.nockTransform;
Util.ResetTransform( currentArrow.transform );
Util.ResetTransform( arrowNockTransform );
}
}


// If arrow is nocked, and we release the trigger
if ( nocked && ( !hand.controller.GetPress( SteamVR_Controller.ButtonMask.Trigger ) || hand.controller.GetPressUp( SteamVR_Controller.ButtonMask.Trigger ) ) )
{
if ( bow.pulled ) // If bow is pulled back far enough, fire arrow, otherwise reset arrow in arrowhand
{
FireArrow();
}
else
{
arrowNockTransform.rotation = currentArrow.transform.rotation;
currentArrow.transform.parent = arrowNockTransform;
Util.ResetTransform( currentArrow.transform );
nocked = false;
bow.ReleaseNock();
hand.HoverUnlock( GetComponent<Interactable>() );
allowTeleport.teleportAllowed = true;
}

bow.StartRotationLerp(); // Arrow is releasing from the bow, tell the bow to lerp back to controller rotation
}
}


//-------------------------------------------------
private void OnDetachedFromHand( Hand hand )
{
Destroy( gameObject );
}


//-------------------------------------------------
private void FireArrow()
{
currentArrow.transform.parent = null;

Arrow arrow = currentArrow.GetComponent<Arrow>();
arrow.shaftRB.isKinematic = false;
arrow.shaftRB.useGravity = true;
arrow.shaftRB.transform.GetComponent<BoxCollider>().enabled = true;

arrow.arrowHeadRB.isKinematic = false;
arrow.arrowHeadRB.useGravity = true;
arrow.arrowHeadRB.transform.GetComponent<BoxCollider>().enabled = true;

arrow.arrowHeadRB.AddForce( currentArrow.transform.forward * bow.GetArrowVelocity(), ForceMode.VelocityChange );
arrow.arrowHeadRB.AddTorque( currentArrow.transform.forward * 10 );

nocked = false;

currentArrow.GetComponent<Arrow>().ArrowReleased( bow.GetArrowVelocity() );
bow.ArrowReleased();

allowArrowSpawn = false;
Invoke( "EnableArrowSpawn", 0.5f );
StartCoroutine( ArrowReleaseHaptics() );

currentArrow = null;
allowTeleport.teleportAllowed = true;
}


//-------------------------------------------------
private void EnableArrowSpawn()
{
allowArrowSpawn = true;
}


//-------------------------------------------------
private IEnumerator ArrowReleaseHaptics()
{
yield return new WaitForSeconds( 0.05f );

hand.otherHand.controller.TriggerHapticPulse( 1500 );
yield return new WaitForSeconds( 0.05f );

hand.otherHand.controller.TriggerHapticPulse( 800 );
yield return new WaitForSeconds( 0.05f );

hand.otherHand.controller.TriggerHapticPulse( 500 );
yield return new WaitForSeconds( 0.05f );

hand.otherHand.controller.TriggerHapticPulse( 300 );
}


//-------------------------------------------------
private void OnHandFocusLost( Hand hand )
{
gameObject.SetActive( false );
}


//-------------------------------------------------
private void OnHandFocusAcquired( Hand hand )
{
gameObject.SetActive( true );
}


//-------------------------------------------------
private void FindBow()
{
bow = hand.otherHand.GetComponentInChildren<Longbow>();
}
}
}

7
Action Requests / Anyone know how to make an action for this script?
« on: July 23, 2017, 04:13:04 PM »
Hello!

Ok, I have this script (below) and I wanted to know if anyone knew how to make this into an action that "happens" when an fsm is activated or event triggered(more likely)?  Currently, the controller has to be over the object in order for this to work and the trigger pressed or not pressed, but it works on a collider system. I would like instead of physically being over the object to be activated by trigger within playmaker.  Is this possible? I can't read c# very well or enough really to understand how this script works. Any help would be great!

Code: [Select]
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Handles the spawning and returning of the ItemPackage
//
//=============================================================================

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine.Events;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace Valve.VR.InteractionSystem
{
//-------------------------------------------------------------------------
[RequireComponent( typeof( Interactable ) )]
public class ItemPackageSpawner : MonoBehaviour
{
public ItemPackage itemPackage
{
get
{
return _itemPackage;
}
set
{
CreatePreviewObject();
}
}

public ItemPackage _itemPackage;

private bool useItemPackagePreview = true;
private bool useFadedPreview = false;
private GameObject previewObject;

public bool requireTriggerPressToTake = false;
public bool requireTriggerPressToReturn = false;
public bool showTriggerHint = false;

[EnumFlags]
public Hand.AttachmentFlags attachmentFlags = Hand.defaultAttachmentFlags;
public string attachmentPoint;

public bool takeBackItem = false; // if a hand enters this trigger and has the item this spawner dispenses at the top of the stack, remove it from the stack

public bool acceptDifferentItems = false;

private GameObject spawnedItem;
private bool itemIsSpawned = false;

public UnityEvent pickupEvent;
public UnityEvent dropEvent;

public bool justPickedUpItem = false;


//-------------------------------------------------
private void CreatePreviewObject()
{
if ( !useItemPackagePreview )
{
return;
}

ClearPreview();

if ( useItemPackagePreview )
{
if ( itemPackage == null )
{
return;
}

if ( useFadedPreview == false ) // if we don't have a spawned item out there, use the regular preview
{
if ( itemPackage.previewPrefab != null )
{
previewObject = Instantiate( itemPackage.previewPrefab, transform.position, Quaternion.identity ) as GameObject;
previewObject.transform.parent = transform;
previewObject.transform.localRotation = Quaternion.identity;
}
}
else // there's a spawned item out there. Use the faded preview
{
if ( itemPackage.fadedPreviewPrefab != null )
{
previewObject = Instantiate( itemPackage.fadedPreviewPrefab, transform.position, Quaternion.identity ) as GameObject;
previewObject.transform.parent = transform;
previewObject.transform.localRotation = Quaternion.identity;
}
}
}
}


//-------------------------------------------------
void Start()
{
VerifyItemPackage();
}


//-------------------------------------------------
private void VerifyItemPackage()
{
if ( itemPackage == null )
{
ItemPackageNotValid();
}

if ( itemPackage.itemPrefab == null )
{
ItemPackageNotValid();
}
}


//-------------------------------------------------
private void ItemPackageNotValid()
{
Debug.LogError( "ItemPackage assigned to " + gameObject.name + " is not valid. Destroying this game object." );
Destroy( gameObject );
}


//-------------------------------------------------
private void ClearPreview()
{
foreach ( Transform child in transform )
{
if ( Time.time > 0 )
{
GameObject.Destroy( child.gameObject );
}
else
{
GameObject.DestroyImmediate( child.gameObject );
}
}
}


//-------------------------------------------------
void Update()
{
if ( ( itemIsSpawned == true ) && ( spawnedItem == null ) )
{
itemIsSpawned = false;
useFadedPreview = false;
dropEvent.Invoke();
CreatePreviewObject();
}
}


//-------------------------------------------------
private void OnHandHoverBegin( Hand hand )
{
ItemPackage currentAttachedItemPackage = GetAttachedItemPackage( hand );

if ( currentAttachedItemPackage == itemPackage ) // the item at the top of the hand's stack has an associated ItemPackage
{
if ( takeBackItem && !requireTriggerPressToReturn ) // if we want to take back matching items and aren't waiting for a trigger press
{
TakeBackItem( hand );
}
}

if ( !requireTriggerPressToTake ) // we don't require trigger press for pickup. Spawn and attach object.
{
SpawnAndAttachObject( hand );
}

if ( requireTriggerPressToTake && showTriggerHint )
{
ControllerButtonHints.ShowTextHint( hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger, "PickUp" );
}
}


//-------------------------------------------------
private void TakeBackItem( Hand hand )
{
RemoveMatchingItemsFromHandStack( itemPackage, hand );

if ( itemPackage.packageType == ItemPackage.ItemPackageType.TwoHanded )
{
RemoveMatchingItemsFromHandStack( itemPackage, hand.otherHand );
}
}


//-------------------------------------------------
private ItemPackage GetAttachedItemPackage( Hand hand )
{
GameObject currentAttachedObject = hand.currentAttachedObject;

if ( currentAttachedObject == null ) // verify the hand is holding something
{
return null;
}

ItemPackageReference packageReference = hand.currentAttachedObject.GetComponent<ItemPackageReference>();
if ( packageReference == null ) // verify the item in the hand is matchable
{
return null;
}

ItemPackage attachedItemPackage = packageReference.itemPackage; // return the ItemPackage reference we find.

return attachedItemPackage;
}


//-------------------------------------------------
private void HandHoverUpdate( Hand hand )
{
if ( requireTriggerPressToTake )
{
if ( hand.controller != null && hand.controller.GetHairTriggerDown() )
{
SpawnAndAttachObject( hand );
}
}
}


//-------------------------------------------------
private void OnHandHoverEnd( Hand hand )
{
if ( !justPickedUpItem && requireTriggerPressToTake && showTriggerHint )
{
ControllerButtonHints.HideTextHint( hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger );
}

justPickedUpItem = false;
}


//-------------------------------------------------
private void RemoveMatchingItemsFromHandStack( ItemPackage package, Hand hand )
{
for ( int i = 0; i < hand.AttachedObjects.Count; i++ )
{
ItemPackageReference packageReference = hand.AttachedObjects[i].attachedObject.GetComponent<ItemPackageReference>();
if ( packageReference != null )
{
ItemPackage attachedObjectItemPackage = packageReference.itemPackage;
if ( ( attachedObjectItemPackage != null ) && ( attachedObjectItemPackage == package ) )
{
GameObject detachedItem = hand.AttachedObjects[i].attachedObject;
hand.DetachObject( detachedItem );
}
}
}
}


//-------------------------------------------------
private void RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType packageType, Hand hand )
{
for ( int i = 0; i < hand.AttachedObjects.Count; i++ )
{
ItemPackageReference packageReference = hand.AttachedObjects[i].attachedObject.GetComponent<ItemPackageReference>();
if ( packageReference != null )
{
if ( packageReference.itemPackage.packageType == packageType )
{
GameObject detachedItem = hand.AttachedObjects[i].attachedObject;
hand.DetachObject( detachedItem );
}
}
}
}


//-------------------------------------------------
private void SpawnAndAttachObject( Hand hand )
{
if ( hand.otherHand != null )
{
//If the other hand has this item package, take it back from the other hand
ItemPackage otherHandItemPackage = GetAttachedItemPackage( hand.otherHand );
if ( otherHandItemPackage == itemPackage )
{
TakeBackItem( hand.otherHand );
}
}

if ( showTriggerHint )
{
ControllerButtonHints.HideTextHint( hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger );
}

if ( itemPackage.otherHandItemPrefab != null )
{
if ( hand.otherHand.hoverLocked )
{
//Debug.Log( "Not attaching objects because other hand is hoverlocked and we can't deliver both items." );
return;
}
}

// if we're trying to spawn a one-handed item, remove one and two-handed items from this hand and two-handed items from both hands
if ( itemPackage.packageType == ItemPackage.ItemPackageType.OneHanded )
{
RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType.OneHanded, hand );
RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType.TwoHanded, hand );
RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType.TwoHanded, hand.otherHand );
}

// if we're trying to spawn a two-handed item, remove one and two-handed items from both hands
if ( itemPackage.packageType == ItemPackage.ItemPackageType.TwoHanded )
{
RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType.OneHanded, hand );
RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType.OneHanded, hand.otherHand );
RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType.TwoHanded, hand );
RemoveMatchingItemTypesFromHand( ItemPackage.ItemPackageType.TwoHanded, hand.otherHand );
}

spawnedItem = GameObject.Instantiate( itemPackage.itemPrefab );
spawnedItem.SetActive( true );
hand.AttachObject( spawnedItem, attachmentFlags, attachmentPoint );

if ( ( itemPackage.otherHandItemPrefab != null ) && ( hand.otherHand.controller != null ) )
{
GameObject otherHandObjectToAttach = GameObject.Instantiate( itemPackage.otherHandItemPrefab );
otherHandObjectToAttach.SetActive( true );
hand.otherHand.AttachObject( otherHandObjectToAttach, attachmentFlags );
}

itemIsSpawned = true;

justPickedUpItem = true;

if ( takeBackItem )
{
useFadedPreview = true;
pickupEvent.Invoke();
CreatePreviewObject();
}
}
}
}

8
Playmaker Help / Re: Action to Break Prefab Instance?
« on: July 20, 2017, 09:22:32 PM »
Essentially what I am doing is firing a clone of an arrow with the ability to change what kind of arrow it is for the next one.  However, when I select the next type of arrow, it changes the original as well.

Example, Arrow is selected as fire arrow, its fired, then an ice arrow is selected quickly, the new arrow turns into an ice arrow and is ready to fire, however, the original fire arrow has changed mid flight into an ice arrow.

9
Playmaker Help / Action to Break Prefab Instance?
« on: July 19, 2017, 01:47:15 PM »
Hello! I want to know if there is an action or way to break a prefab instance after a certain time or (xxxx) happens?

10
VR Help / Desperately Need Help with SteamVR WorkFlow
« on: July 18, 2017, 01:35:01 PM »
Hello!

Ok, I'm having problems with a workflow and I'm not sure if anyone can help me but here goes.

I'm using STEAM VR and essentially what happens when using the Bow and Arrow example scene is that the arrow instantiated is a clone made from the original game object.  Now that is all and good, however, in my application, I have 4 options to change the arrow that is displayed, which works sort of. The problem is, when the new arrow is instantiated, it is the original arrow that is made a clone of.  I've been trying to change the variable of the arrow itself, which only works until the arrow is fired, then a new clone is made and poof, back to square one. 

I tried to modify the original object, which does work, however, the clone seems to be not updating from the original object.  It looks as if the script clones the ArrowHand game object, then after being fired only uses the clone of the cloned object as a reference and doesn't go back to the original object for reference.  I don;t know any c# so I don't exactly understand where it's keeping the Cloned clone.  I'm including the scripts and a sample scene, though I'm not sure how much of the sample scene may be missing (if you download steam VR plugin it may fill in the missing prefabs.

I'm including scripts and a scene file.

11
Hi,

 Have you tried "Get Root", it's likely what you need. Else I'll do a custom action.

 Bye,

 Jean

Thank you so much for the suggestion. Although what you mentioned didn't exactly work (though it did literally do what it was meant to do) I had a nested gameobject within a game object:

Arrow
Misc (folder)
Arrows-->
     ->Base Arrow
          ->Arrow Prop
     ->Ice Arrow
          ->Arrow Prop

So the get parent got the parent of the immediate folder.  So it did what it was suppose to, but I needed to get the Root parent. This is because when the arrow is fired, the parent tag determines what effect the target displays. (Ice Arrow = Ice effect on target) ect..

So although your method may have not worked, it definitely put me on the path to discovering how to use "Get (whatever) action.  Which led me to do a down and dirty mod to do it.  I don't know if there is an action that makes this easier than the way I did it, but this is what I have done:





I don't know if there is a n easier way or maybe an action that streamlines all this, but this seems to work pretty good.

Oh and I should mention, the arrow objects within the gameobject are enabled and disabled on command, thus starting the FSM that turns the tag to whatever arrow it is.

12
Playmaker Help / Possible to change tag of parent?
« on: July 08, 2017, 02:06:32 PM »
I was wondering if this is possible:

I have an arrow that has a bunch of varieties within its hierarchy, I cannot make these into separate prefabs for various reasons.  I can enable and disable the sub-arrows but I also need the parent tag that holds all the arrows to change.

Example:

Ice arrow is enabled, Parent Tag changes to Ice Arrow
Fire arrow is enabled, Parent tag is changed to Fire Arrow.

I also need this to be on an individual basis, so the tag cannot change on the entire prefab otherwise the arrows would change type in mid-flight.

Is this possible?

13
Playmaker Help / Playmaker and Ragdolls
« on: July 02, 2017, 04:36:59 PM »
Hey, everyone, I've been looking around and I'm not sure if I'm just looking for the wrong search topic or what, so sorry if its covered somewhere I missed it.  Essentially I want to have my NPC running then when he gets hit with a collider have him turn into a ragdoll.  Ideally, if it's possible to get the last frame of his animation and use that as the base of the ragdoll falling position.

14
Playmaker Help / Re: Help getting value from script...
« on: June 12, 2017, 06:08:31 PM »
hmmm it should, change the vairables to public and try again, i just tested it out and it worked for me

Thank you that did work, I appreciate your help!

15
Playmaker Help / Re: Help getting value from script...
« on: June 11, 2017, 04:14:39 PM »
attach the script to your enemy gameobject and drag it down to your fsm state, select the get or set depending on what you're trying to do, you would see a drop down with a list of the scrips variables, functions etc, you can also use the invoke method action to call a functions script, depends on what you really want, try that, the script looks pretty old because i see some references that aren't initialized in the name space like Ai. but test it out tho.

When I drag the script into the Get property action in the fsm I do have options, but none that are listed within the script itself?

Pages: [1] 2 3