i’m trying to get a gameboject (a partical effect) to follow the player. Here is what I have. How can I get this to work? Thanks.
using UnityEngine;
using System.Collections;
public class RainControler : MonoBehaviour
{
vp_FPSPlayer player = GetComponent<vp_FPSPlayer>();
Transform rain;
float rainHeight = 4;
void Start () {}
void Update ()
{
rain.position = Vector3(player.transform.position.x, player.transform.position.y + rainHeight, player.transform.position.x);
}
}