Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make the Start/End Prefab able to be Raycasted?
#5
I made what you said and i can hold my rope now, but i when i pick it up, i have only the end and start prefab in my hands.
The rope is away  Ángel

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

   void FixedUpdate()
   {
       if (m_rope == null)
           return;

       if (m_handleGO == null)
           return;

       if (m_handle == null)
           return;  


       m_handleGO.transform.position = Vector3.Lerp(transform.position, PlayerCamera.Instance.transform.position + PlayerCamera.Instance.transform.forward * .8f, Time.deltaTime * 20);

       // Add the selected particle(s) to the handle:
       for (int i = 0; i < m_rope.invMasses.Length; ++i)
       {
           m_handle.AddParticle(i, m_handleGO.transform.position, m_rope.invMasses[i]);
       }
   }
How do i set the position of each particle? Sorry for this questions, but i bought this asset a day ago and i can't understand how to use it  Sonrojado
Reply


Messages In This Thread
RE: How to make the Start/End Prefab able to be Raycasted? - by Rexima - 30-10-2017, 09:05 PM