Skip to content

Instantly share code, notes, and snippets.

View Eriard's full-sized avatar

Markus Lange Eriard

View GitHub Profile
@saturngamesss
saturngamesss / GrapplingGunRaycasthit2D.cs
Created July 1, 2020 15:09
Grappling gun with raycasthit2D code for Unity.
//************** REAL GAMES STUDIO ***************
//************************************************
//realgamesss.weebly.com
//gamejolt.com/@Real_Game
//realgamesss.newgrounds.com/
//real-games.itch.io/
//youtube.com/channel/UC_Adg-mo-IPg6uLacuQCZCQ
//************************************************
using UnityEngine;
@ManeFunction
ManeFunction / EasingFunctions.cs
Last active March 23, 2026 04:31 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
* Refactored by Mane Function
*
* The MIT License (MIT)
*
* Copyright (c) 2019-2023
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@spaghettiSyntax
spaghettiSyntax / 2DUnityScreenShake.cs
Created March 12, 2020 01:37
A simple 2D screen shake built in Unity.
using UnityEngine;
public class ScreenShakeController : MonoBehaviour
{
// This is a singleton
public static ScreenShakeController _instance;
public float shakeTimeRemaining = 1f;
private float shakePower = 0.5f;
private float shakeFadeTime;
@FreyaHolmer
FreyaHolmer / FlyCamera.cs
Last active January 15, 2026 01:09
A camera controller for easily flying around a scene in Unity smoothly. WASD for lateral movement, Space & Ctrl for vertical movement, Shift to move faster. Add this script to an existing camera, or an empty game object, hit play, and you're ready to go~
using UnityEngine;
[RequireComponent( typeof(Camera) )]
public class FlyCamera : MonoBehaviour {
public float acceleration = 50; // how fast you accelerate
public float accSprintMultiplier = 4; // how much faster you go when "sprinting"
public float lookSensitivity = 1; // mouse look sensitivity
public float dampingCoefficient = 5; // how quickly you break to a halt after you stop your input
public bool focusOnEnable = true; // whether or not to focus and lock cursor immediately on enable
@delphic
delphic / AnimationController.cs
Last active February 14, 2025 02:51
Unity3D Playables API Based Character Animation Controller
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Playables;
[RequireComponent(typeof(Animator))]
public class AnimationController : MonoBehaviour
{
const string ANIMATION = "Animation";
PlayableGraph _playableGraph;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
public float speedX;
public float accelX;
public float decelX;
public float gravity;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BoxMover : MonoBehaviour
{
public enum Slide
{
None,
Perpendicular,
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@vybstat
vybstat / ds_store_removal
Last active September 18, 2025 18:40
How to remove .DS_Store file from GitHub that Mac OS X creates
# remove .DS_Store file from GitHub that MAC OS X creates
# find and remove .DS_Store
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
# create .gitignore file, if needed
touch .gitignore
echo .DS_Store > .gitignore
# push changes to GitHub
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 14, 2026 10:33
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights