Pull request #29: Cannot Grapple Spikes anymore

Merge in CEGJ/32bit_jam_conjure from GrappleStunFix to Dev

* commit '1c8c15c7efd5c539f6a903fae1f55324f50ffc1c':
  Cannot Grapple Spikes anymore
This commit is contained in:
Louis Horlaville 2022-10-30 21:29:03 +00:00 committed by Soulaha
commit b0584dd46d

View File

@ -92,14 +92,26 @@ public class GrappleHook : MonoBehaviour
hitMarkerRect.anchoredPosition = WorldToUI(gameObject.transform.position + aimDir * maxGrappleDist);
if (Physics.Raycast(gameObject.transform.position, aimDir, out hit, maxGrappleDist, grappleableLayer)) {
if (hit.transform.gameObject.layer != 7)
{
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green;
if(grappling){
if (grappling)
{
StartGrapple(hit);
}else{
}
else
{
grappling = false;
}
}
else
{
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.red;
}
}else{
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.red;
}