Added magnet functionality

This commit is contained in:
Martin
2022-12-23 11:36:12 +01:00
parent afc9448826
commit 76c4264838
15 changed files with 193 additions and 13 deletions

View File

@@ -0,0 +1,6 @@
import { Vec3 } from "cc";
export function getDirection(targetPosition: Vec3, sourcePosition: Vec3): Vec3 {
const direction: Vec3 = new Vec3();
return Vec3.subtract(direction, targetPosition, sourcePosition).normalize();
}