mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2024-12-26 03:38:58 +00:00
7 lines
232 B
TypeScript
7 lines
232 B
TypeScript
import { Vec3 } from "cc";
|
|
|
|
export function getDirection(targetPosition: Vec3, sourcePosition: Vec3): Vec3 {
|
|
const direction: Vec3 = new Vec3();
|
|
return Vec3.subtract(direction, targetPosition, sourcePosition).normalize();
|
|
}
|