03-11-2017, 10:15 AM
(This post was last modified: 03-11-2017, 10:16 AM by josemendez.)
(02-11-2017, 10:57 PM)Rexima Wrote: Sorry, but i need to ask you again
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);