I use the post processing plugin and want the vignette to follow the player, means: the center of the vignette should always be at the players position.
However I get an error, postprocessing vector2 cant be converted into unity.engine vector2?
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine;
public class ViewOtherWorld : MonoBehaviour
{
PostProcessVolume postProcProf;
[SerializeField] Transform player;
Vignette m_vignette;
private void Start() {
postProcProf = GetComponent();
postProcProf.profile.TryGetSettings(out m_vignette);
}
private void Update() {
m_vignette.center = new Vector2(player.position.x, player.position.y);
}
}
↧