New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rbxts/easy-path

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rbxts/easy-path

This package will help you build paths with smooth turns

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

📈 EasyPath

EasyPath will give you the ability to create smooth paths, this package is ideal for TD games where you want the most optimized enemy system possible.

Example

A code snippet showing how to set up and use EasyPath.

const cframes = [
	new CFrame(11.39, 0.5, -14.8),
	new CFrame(11.39, 0.5, -30.03),
	new CFrame(13.7, 0.5, -32.44).mul(CFrame.fromOrientation(0, math.rad(90), 0))
]

const path = new EasyPath(cframes);
path.Visualize();

const part = new Instance("Part", Workspace);
part.Size = Vector3.one;
part.Anchored = true;
part.CanCollide = false;

let dist = 0;
while (dist <= path.GetLength()) {
	dist += 1;
	part.CFrame = path.CalculateCFrameByLength(dist);
	task.wait(0.1);
}

API

  • new EasyPath(cframes: CFrame[])

Takes an array of cframes to be used as waypoints and returns a path object.

  • Path.CalculateCFrame(t: number)

Takes in a t value from 0-1 and returns a uniform cframe across the path object.

  • Path.CalculateCFrameByLength(lenght: number)

Takes the path length and returns a uniform frame over the entire path object.

  • Path:GetPathLength()

Returns the path objects length.

Keywords

FAQs

Package last updated on 25 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc