From Bohemia Interactive Community
Raycast Terrain(Origin, Direction, Max distance, On ground hit, On missed)
static raycastTerrain(origin: YVector3, direction: YVector3, maxDistance: number, onGroundHit: (hitPosition: YVector3, hitNormal: YVector3) => void, onMissed: () => void): void;
Parameters
origin
The starting point of the ray in world coordinates.
direction
The direction vector of the ray.
maxDistance
The maximum distance the ray should check for collisions.
onGroundHit
Called when the ray collides with the terrain.
onMissed
Called when the ray doesn't collide with anything in the length of it's max distance parameter.
Returns
void Returns true if the ray intersects with the Terrain, otherwise false.
Description
Casts a ray, from origin point, in a direction, of a maximal length, against the terrain colliders of the scene.
Notes
- To get a Direction Vector parameter, use Vector(TransformPosition(Target) - TransformPosition(Origin)).
Ylands - Editor
|
Editor
|
Animated objects,
Custom UI,
Entity welding,
Game export,
Game ID,
Monetization,
MIDI music,
Optimizations,
Common Problems,
FAQ
|
Script
|
Introduction,
Conventions,
Client script,
Text scripting,
Custom controls,
Custom controller,
Storage Data,
Game set,
Leaderboards,
Matchmaking,
Map markers
|
Game logic
|
AI Behaviour,
Ask Player,
Controller,
Custom Camera,
Custom Controls,
Custom HUD,
Custom Window,
Data Set,
Dialogue,
Entity Label,
Entity Storage,
Entity Template,
Environment,
Event Listener,
Game Logic Label,
Game Logic Storage,
Game Logic Template,
Global Storage,
Group Template,
Image Library,
Impassable Barrier,
Light,
Melee Attack Effect,
Particle Effect,
Particle Template,
Path,
Play Area,
Player Role,
Player Team,
Position Animator,
Post Process,
Reference Point,
Resource,
Rotation Animator,
Script Module,
Skill,
Sound Effect,
Spawn Point,
Time Trigger,
Transaction,
Trigger Zone,
Voice Chat Channel,
Water Volume
|
Script tiles
|
Game,
Entities,
Game Logic,
Logic,
Loops,
Instructions,
Number,
Vector,
Color,
String,
Array
|
Misc
|
WIKI FAQ
|