Skip to content

Instantly share code, notes, and snippets.

@remusjones
remusjones / EasingFunctions.cpp
Last active December 10, 2023 01:51
Ports the Easings formulas from https://easings.net/ into an Unreal Engine Blueprint Function Library
#include "EasingFunctions.h"
float UEasingFunctions::EaseInSine(const float Input)
{
return 1 - FMath::Cos(Input * UE_PI) / 2;
}
float UEasingFunctions::EaseOutSine(const float Input)
{
return FMath::Cos(Input * UE_PI) / 2;
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string ToLower(string str)
{
for(auto& c : str)
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
void OnParticleCollision(GameObject other)
{
ParticleSystem.Particle[] particles = new ParticleSystem.Particle[m_hitAnim.particleCount];
m_hitAnim.GetParticles(particles);
ParticleCollisionEvent[] collEvent = new ParticleCollisionEvent[16];
// Check if player is dead
if (m_health <= 0)
{
// Create a new vector3 and store the position
Vector3 newPos = transform.position;
// Loop through and instantiate blood at a random rotation x amount of times
for (int i = 0; i < m_bloodAmount; i++)
{
randomRotation = Quaternion.Euler(Random.Range(0.0f, 360.0f), Random.Range(0.0f, 360.0f), Random.Range(0.0f, 360.0f));