30-10-2017, 09:05 PM
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
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
The rope is away
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]);
}
}