keijiro / KinoDatamosh

An image effect for Unity that simulates video compression artifacts
The Unlicense
470 stars 21 forks source link

Triggering the Glitch in script #3

Closed caseyfarina closed 4 years ago

caseyfarina commented 6 years ago

I'm not sure how to trigger the Glitch function in a script. The following does not seem to be working. Keijiro, your work is amazing and prolific. Thank you for sharing all these amazing explorations.

`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Kino;

public class cam2 : MonoBehaviour {

    public Camera cam22;
    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void Update () {
        if (Input.GetKeyDown("a"))
        {
            cam22.GetComponent<Datamosh>().Glitch();
        }
    }
}
`
keijiro commented 6 years ago

It should work. Make sure that entropy is larger than 0.0.