Currently I’m working on a top view ball game and I would like to have icy floor parts in it. I plan to do it with using object and collider, but I have absolute no idea how to start. The object (with tag ‘IceFloor’) would be a few above the ground on y with a trigger on collider and when the player ball would go onto it it should behave like if it would be on ice.
Currently what I have is the ball with a controlling script which is simply moving the ball with arrow keys:
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
void FixedUpdate () {
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
GetComponent<Rigidbody>().AddForce (movement * speed * Time.deltaTime);
}
}
I don’t have any Physic material yet, not even sure if needed, and if yes where and how. I’m very new to coding. I would really appriciate any help. It would really make me very happy it could work.