I’m creating Skatting 2D game
Now playing with X,Y axis. My problem is i want a ball to slide down from hill along with ice way and slide down faster as long as the ball is still on the ice plane
.
I have tried to change velocity of the ball when it touch the ice plane but it go only one axis or sometimes it goes to the sky
here is my code
public bool isGround;
void Update ()
{
if(isGround)
{
//transform.rigidbody.velocity = transform.rigidbody.velocity * Time.deltaTime;
//rigidbody.AddForce(new Vector3(3,0,0),ForceMode.VelocityChange);
rigidbody.AddForce(new Vector3(3,3,0),ForceMode.VelocityChange);
}
}
void OnColliderEnter(Collider other)
{
if(other.transform.CompareTag("BoxArea"))
{Physics.IgnoreCollision(transform.collider,other);}
}
void OnCollisionEnter(Collision other)
{
if(other.transform.CompareTag("IcePlane"))
{
isGround = true;
}
}