Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make the Start/End Prefab able to be Raycasted?
#12
(02-11-2017, 10:57 PM)Rexima Wrote: Sorry, but i need to ask you again  Sonrojado

When i want to grab the End Prefab, my handle will be created on the Start Prefab and im carrying it not the End Prefab.
But when i grab the Start Prefab, its okay.


Code:
   public override void OnInteract(NetworkIdentity _player, bool _release)
   {
           base.OnInteract(_player, _release);

           m_handleGO = new GameObject("Obi Handle");
           m_handle = m_handleGO.AddComponent<ObiParticleHandle>();
           m_handle.Actor = m_rope;

           Debug.Log("Interact with: " + gameObject.name);

           m_handleGO.transform.position = transform.position;

           m_handle.AddParticle(0, transform.position, 1f);
       }        
   }

Hi,

You need to change the particle you're adding to the handle. To grab the start of the rope, you should add first particle to the handle (index 0, like you have now). To grab the end of the rope, add the last particle in the rope instead:


Code:
m_handle.AddParticle( rope.UsedParticles-1, transform.position, 1f);
Reply


Messages In This Thread
RE: How to make the Start/End Prefab able to be Raycasted? - by josemendez - 03-11-2017, 10:15 AM