Colshape::isPointWithin: Difference between revisions
m (→Syntax: Fixed syntax) |
mNo edit summary |
||
| (5 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{ServersideJsFunction}} | |||
Checking if a point is within the colshape. | Checking if a point is within the colshape. | ||
==Parameters== | ==Parameters== | ||
* '''position: | * '''position:''' {{RageType|Vector3}} | ||
==Syntax== | ==Syntax== | ||
< | {{ServersideCode| | ||
<pre> | |||
Boolean colshape.isPointWithin(position); | |||
colshape.isPointWithin(position); | </pre> | ||
</ | }} | ||
== Example == | |||
{{ServersideCode| | |||
<pre> | |||
let position = player.position; | |||
if (colshape.isPointWithin(position)) { | |||
console.log("Inside Colshape"); | |||
} else { | |||
console.log("Outside Colshape"); | |||
} | |||
</pre> | |||
}} | |||
==See Also== | ==See Also== | ||
{{Colshapes_function}} | {{Colshapes_function}} | ||
[[Category:ColShape API]] | |||
[[Category:Server-side Function]] | |||
Latest revision as of 13:02, 21 November 2021
Server-Side Function
Checking if a point is within the colshape.
Parameters
- position: Vector3
Syntax
Server-Side
Boolean colshape.isPointWithin(position);
Example
Server-Side
let position = player.position;
if (colshape.isPointWithin(position)) {
console.log("Inside Colshape");
} else {
console.log("Outside Colshape");
}
See Also
- Functions
- Properties
- Arrays
- Functions