playMaker

Author Topic: Desperately Need Help with SteamVR WorkFlow  (Read 123 times)

beowulfkaine

  • Playmaker Newbie
  • *
  • Posts: 43
    • View Profile
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.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 1835
    • View Profile
Re: Desperately Need Help with SteamVR WorkFlow
« Reply #1 on: July 18, 2017, 08:43:39 PM »
Hi,
I can't test at the moment.
But maybe you should look into making a pool system.
Create and destroy is 'expensive' and leaves 'garbage'.

You can get for example easy pool manager from the asset store

or you can build your own system using arrays.

You can have 2 or more arrows for each kind (depending on how many arrow you want maximum to have in your scene)

If you plan to use easy pool manager, let me know so i can make some action for it to use.