Hello! I’m on lecture 91 and when I opened my project today, I noticed these 2 errors that showed up in the console. They read as follows:
Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations
So these showed up when I loaded my project, but every time I preform certain actions (such as moving a Game Object with the move tool, placing a prefab, or quite literally anything besides clicking around the hierarchy) , I get these errors again. They also show up over and over when I enter play mode. This leads to hundreds and hundreds of repeats of these same two errors in my console. I’m just super confused as to why this is happening. Any help would be greatly appreciated! Here’s my Player.cs file in its current state:
using System;
using UnityEngine;
public class Player : MonoBehaviour
{
// config params
[SerializeField] float moveSpeed = 10f;
[SerializeField] float padding = 1f;
[SerializeField] GameObject laserPrefab;
float xMin;
float xMax;
float yMin;
float yMax;
// Start is called before the first frame update
void Start()
{
setUpMoveBoundaries();
}
// Update is called onceer frame
void Update()
{
Move();
Fire();
}
private void Fire()
{
if (Input.GetButtonDown("Fire1"))
{
Instantiate(laserPrefab, transform.position, Quaternion.identity);
}
}
private void Move()
{
var deltaX = Input.GetAxis("Horizontal") * Time.deltaTime * moveSpeed;
var deltaY = Input.GetAxis("Vertical") * Time.deltaTime * moveSpeed;
var newXPos = Mathf.Clamp(transform.position.x + deltaX, xMin, xMax);
var newYPos = Mathf.Clamp(transform.position.y + deltaY, yMin, yMax);
transform.position = new Vector2(newXPos, newYPos);
}
private void setUpMoveBoundaries()
{
Camera gameCamera = Camera.main;
xMin = gameCamera.ViewportToWorldPoint(new Vector3(0, 0, 0)).x + padding;
xMax = gameCamera.ViewportToWorldPoint(new Vector3(1, 0, 0)).x - padding;
yMin = gameCamera.ViewportToWorldPoint(new Vector3(0, 0, 0)).y + padding;
yMax = gameCamera.ViewportToWorldPoint(new Vector3(0, 1, 0)).y - padding;
}
}