Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  harpoon with obi rope
#12
(19-10-2022, 08:20 AM)RuralSculpture Wrote: Here its my code;

Vector3 dir = (character.transform.position - Graping.Instance.CurrentTarget.position).normalized;

        Ray ray = new Ray(transform.position, dir);

video: https://we.tl/t-ewWHIFlvXl

That doesn't make any sense, it will shoot a ray from the grappling hook in the direction that goes from the target to the character.

If you intend to cast a ray from the character position towards the target, it should be:

Code:
Vector3 dir = (Graping.Instance.CurrentTarget.position - character.transform.position).normalized;
Ray ray = new Ray(character.transform.position, dir);

This is extremely simple vector math, not related to Obi in any way. If you need help with vectors, I strongly suggest you follow some tutorials about them first. Otherwise you'll be constantly getting stuck on basic stuff, that I can't help you with.
Reply


Messages In This Thread
harpoon with obi rope - by RuralSculpture - 18-10-2022, 09:11 AM
RE: harpoon with obi rope - by josemendez - 18-10-2022, 09:39 AM
RE: harpoon with obi rope - by RuralSculpture - 18-10-2022, 11:23 AM
RE: harpoon with obi rope - by josemendez - 18-10-2022, 11:52 AM
RE: harpoon with obi rope - by RuralSculpture - 18-10-2022, 11:56 AM
RE: harpoon with obi rope - by josemendez - 18-10-2022, 12:06 PM
RE: harpoon with obi rope - by RuralSculpture - 18-10-2022, 12:20 PM
RE: harpoon with obi rope - by josemendez - 18-10-2022, 12:44 PM
RE: harpoon with obi rope - by RuralSculpture - 18-10-2022, 03:34 PM
RE: harpoon with obi rope - by josemendez - 18-10-2022, 03:50 PM
RE: harpoon with obi rope - by RuralSculpture - 19-10-2022, 08:20 AM
RE: harpoon with obi rope - by josemendez - 19-10-2022, 09:15 AM