Question by
andreas_abba · Mar 29, 2016 at 12:35 PM ·
jumpfindgameobjectswithtagground detectionisgrounded
How Can I get a bool depending on which instance of the same Game Object i am sitting on ?
Hello i have a very simple script :
using UnityEngine;
using System.Collections;
using UnityStandardAssets.CrossPlatformInput;
public class Jump : MonoBehaviour {
public Rigidbody2D rb;
void Start ()
{
rb = GetComponent<Rigidbody2D>();
}
void Update ()
{
if(CrossPlatformInputManager.GetAxis("Vertical") > 0.7 && GameObject.Find("Ground").GetComponent<Trigger>().IsGrounded)
{
rb.velocity = new Vector2(0,8);
}
}
}
I am using a Tiling (infinite levels) script and i would like to know how to get IsGrounded
depending on which instance of the ground i am. Thank You
Comment
Your answer
Follow this Question
Related Questions
isGrounded not working,is grounded stops players from jumping 1 Answer
Ground check doesnt work 0 Answers
I need help with grounding. 1 Answer
Able to jump in air? (Reward) 1 Answer