Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make the Start/End Prefab able to be Raycasted?
#7
Thank you very much for your help, but how do i know the new position of each particle?

I need to add all Particles once, and than i need to move the handler where my "hand" is.
But the problem is, how to add all Particles, how do i know the new position of them?

This is in my Init void:
Code:
m_handleGO = new GameObject("Obi Handle");
            m_handle = m_handleGO.AddComponent<ObiParticleHandle>();
            m_handle.Actor = m_rope;


            // Add the selected particle(s) to the handle:
            for (int i = 0; i < m_rope.invMasses.Length; ++i)
            {
                m_handle.AddParticle(i, m_rope.GetParticlePosition(i) / m_rope.invMasses[i], m_rope.invMasses[i]);
            }

And this in FixedUpdate to move the Handler:
Code:
m_handleGO.transform.position = Vector3.Lerp(transform.position, PlayerCamera.Instance.transform.position + PlayerCamera.Instance.transform.forward * .8f, Time.deltaTime * 20);

In the Attachment you can see, how it looks, when i pick the rope up.
Reply


Messages In This Thread
RE: How to make the Start/End Prefab able to be Raycasted? - by Rexima - 01-11-2017, 11:23 AM