How can I implement wind to make upper and sideway movement and ice slip for my player.Do I have to use forces? Or is another way cuz I have a charactercollider and to use forces I need to use a rigidbody
I add the rigidbody to my player, and the I put this code in a trigger.
var Player:Transform;
var slip=2;
static var onice=false;
function Start () {
// Auto setup player as target through tags
if (Player == null GameObject.FindWithTag("Player"))
Player = GameObject.FindWithTag("Player").transform;
}
function FixedUpdate () {
if (onice==true)
Player.rigidbody.AddForce (Movementwii.moveDirection * slip);
}
But this is not working for some reason. What is wrong with this code?