using TMPro;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ballscript : MonoBehaviour
{
public Rigidbody2D rb;
[SerializeField] private float initialspeed = 10;
[SerializeField] private float speedinc = 0.25f;
[SerializeField] private TextMeshProUGUI score;
private int hitcount;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
hitcount = 0;
Invoke("StartBall", 2f);
}
// Update is called once per frame
void FixedUpdate()
{
rb.velocity = Vector2.ClampMagnitude(rb.velocity, + (speedinc * hitcount));
print(rb.velocity); //check velocity
}
void StartBall()
{
rb.velocity = new Vector2(-1, 0) * (initialspeed + speedinc * hitcount);
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.name == "puck")
{
hitcount += 1;
}
}
}
OSError: MoviePy error: failed to read the first frame of video file ./Gameplay/minecraft-
gameplay2.mp4. That might mean that the file is corrupted. That may also mean that you are using
a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is
deprecated. Please update to a recent version from the website.