Before updating to Windows 10 you may need to return your Pro license. More information here

Plane.Raycast questions.

Hello. I want to create a swinging mechanic like this, where hook shoots out from the player at a 45 degree angle and the character can swing on it (my game idea is also 2D). Anyways, after asking around, I was told that a way I could accomplish this was to use Plane.Raycast from the player character, check to see if the ray hits an object that the player is able to hook onto, and have my hinge joint put there, how would I do this? specifically, how would I use the raycast to check the object it may be hitting and then, move my hinge to that point?


more ▼

asked Feb 23, 2011 at 06:52 AM

avatar image

Tyler 2
1.1k 638 467 475

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I would suggest to use Physics.Raycast instead of the (limited) Plane.Raycast, because you can get all necessary information from RaycastHit.
Especially for placing the joint you get RaycastHit.point and RaycastHit.normal.

more ▼

answered Feb 23, 2011 at 12:29 PM

avatar image

5.5k 20 41 63

Okay, how would I do that?

Feb 23, 2011 at 10:02 PM Tyler 2
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Feb 23, 2011 at 06:52 AM

Seen: 2463 times

Last Updated: Feb 23, 2011 at 06:52 AM