Skip to content

Instantly share code, notes, and snippets.

@boaheck
boaheck / TFPSinput.cs
Created January 22, 2021 13:15
Enables the use of my project TheFirstPerson(https://github.com/boaheck/TheFirstPerson) with Sophie Houlden's Sinput input system for Unity (https://sophieh.itch.io/sinput)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "SinputCustomInput", menuName = "TFP/SinputCustomInput", order = 1)]
public class TFPSinput : TFPInput
{
public override float XAxis()
{
return Sinput.GetAxisRaw(xInName);
@boaheck
boaheck / CharacterController2D.cs
Created January 24, 2018 21:52
This is a simple unity script that is similar to what the built in unity character controller does in 3D but in 2D. To use this put it on an object with a box collider 2D and a rigidbody2D. Then you can simply call the move function and check the booleans to see if you're grounded etc... Very rough right now but it helps work on a 2d character w…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterController2D : MonoBehaviour {
Rigidbody2D rigb;
BoxCollider2D col;
Vector2 pos, boxSize, boxOffset;
public LayerMask groundLayers;
@boaheck
boaheck / imgfucker.py
Last active May 24, 2022 05:44
ImageGlitcher
#!/usr/bin/env python
import random
import sys
cutLength = 1
pasteDist = 1
frames = 20
imgSequence = False