ArTchie-Bedder-Suite / Docs / BedderScript
BedderScript API reference
Every builtin the sandbox exposes, straight from the manual's appendix. This list is the census: anything not on it does not exist inside a .bedder script.
Every built-in function, generated from the engine's own census (the same table
that drives typechecking and IDE completion), so this list is always complete.
Regenerate after engine changes: Tools → BedderScript → Regenerate API Reference.
143 functions.
Core
print(value)— Write a value to the log.assert(condition, message)— Stop with message when condition is false.len(value) -> int— Length of a string, array, or map.str(value) -> string— Convert any value to a string.int(value) -> int— Convert to a whole number.float(value) -> float— Convert to a decimal number.number(value) -> number— Convert to a number.bool(value) -> bool— Convert to true/false.typeof(value) -> string— Name of a value's type.log(value)— Log a message.warn(value)— Log a warning.error(value)— Log an error.
Math
min(a, b) -> number— Smaller of two numbers.max(a, b) -> number— Larger of two numbers.abs(n) -> number— Absolute value.floor(n) -> int— Round down.ceil(n) -> int— Round up.round(n) -> int— Round to nearest whole number.clamp(n, lo, hi) -> number— Limit a number to a range.lerp(a, b, t) -> number— Blend from a to b by t (0..1).sin(radians) -> float— Sine.cos(radians) -> float— Cosine.sqrt(n) -> float— Square root.pow(n, e) -> float— n raised to e.random() -> float— Random number 0..1.random_range(lo, hi) -> float— Random number in a range.tan(radians) -> number— Tangent.asin(n) -> number— Arc sine (radians).acos(n) -> number— Arc cosine (radians).atan2(y, x) -> number— Angle of a vector (radians).exp(n) -> number— e raised to n.ln(n) -> number— Natural logarithm.sign(n) -> number— -1, 0, or 1.smooth_step(a, b, t) -> number— Eased blend from a to b.ping_pong(t, length) -> number— Bounce t between 0 and length.move_towards(cur, target, maxDelta) -> number— Step toward target without overshooting.repeat(t, length) -> number— Wrap t into 0..length.set_random_seed(n)— Make random() deterministic.
Time
now() -> float— Seconds since play started.delta_time() -> float— Seconds since last frame.get_time() -> float— Seconds since play started.set_timeout(seconds, fn) -> id— Run a function after a delay.
Components
add_component(go, "Rigidbody") -> comp— Add an allow-listed Unity component.get_component(go, "Light") -> comp— Get a component, or 0 when missing.has_component(go, kind) -> bool— True when the component exists.remove_component(go, kind)— Remove a component.
Transform
get_position(go) -> vec3— World position as a vec3 map.set_position(go, x, y, z | go, v)— Move to a world position (numbers or a vec3).translate(go, dx, dy, dz | go, v)— Move relative to current position.look_at(go, x, y, z | go, v)— Face a world point.set_rotation(go, x, y, z | go, v)— Set rotation from euler angles.set_scale(go, x, y, z | go, v)— Set local scale.transform_direction(go, v) -> vec3— Local direction to world space.get_rotation(go) -> vec3— Euler angles as a vec3 map.
Physics
add_force(go, x, y, z | go, v)— Push a rigidbody.set_velocity(go, x, y, z | go, v)— Set rigidbody velocity.get_velocity(go) -> vec3— Rigidbody velocity as a vec3 map.move(go, dx, dy, dz) -> bool— Collision-aware move (CharacterController when present).is_grounded(go) -> bool— CharacterController grounded check.check_sphere(x, y, z, r) -> bool— Anything solid inside a sphere?raycast(origin, dir [, maxDist]) -> hit | null— Cast a ray, get hit info.
Objects
set_active(go, on)— Show or hide an object.get_name(go) -> string— Object name.set_name(go, name)— Rename an object.get_tag(go) -> string— Object tag.set_tag(go, tag)— Set an object's tag.spawn(name) -> go— Create an object from the catalog.destroy(go)— Remove an object from the scene.find(name) -> go | find(s, sub) -> int— Find an object by name (object form wins the typecheck).find_tag(tag) -> array— All objects with a tag.spawn_entity(name, x, y [, w, h]) -> go— Spawn a catalog entity at a position.self() -> go— The object this script runs on.
Vector
vec3(x, y, z) -> vec3— Make a vector map with x/y/z.vec_lerp(a, b, t) -> vec3— Blend between two vectors.vec_length(v) -> float— Vector magnitude.vec_norm(v) -> vec3— Vector scaled to length 1.dot(a, b) -> float— Dot product.distance(a, b) -> float— Distance between two points/objects.vec2(x, y) -> vec2— Make a 2D vector map.color(r, g, b [, a]) -> color— Make a color map.
Events
send_event(go, name, args...) -> bool— Fireon name(...)on the target's scripts.raise_signal(name)— Broadcast a named signal.
Collections
push(arr, value)— Append to an array.pop(arr) -> value— Remove and return the last element.contains(coll, value) -> bool— String/array/map contains a value.index_of(coll, value) -> number— Position of a value, -1 when absent.insert(arr, index, value)— Insert into an array.remove_at(arr, index)— Remove an array element by position.reverse(arr)— Reverse in place.join(arr, sep) -> string— Join elements into a string.clear(coll)— Empty an array or map.sort(arr [, compare])— Sort in place.keys(map) -> array— Map keys.values(map) -> array— Map values.has_key(map, key) -> bool— Map contains a key.remove_key(map, key) -> bool— Remove a map entry.
Input
input_up(action) -> bool— Input released this frame.input_down(action) -> bool— Pressed this frame (GetButtonDown) — the demo scripts' jump.input_axis(axis) -> float— Analog axis (-1..1).input_pressed(action) -> bool— Held (GetButton) — sprint, mining.
Av
set_animation_param(name, param, value)— Set an Animator parameter.stop_sound(name)— Stop a playing sound.play_sound(name)— Play a sound.play_animation(name)— Play an animation state.
Ui
set_ui_text(name, text)— Set a UI text element.set_ui_visible(name, on)— Show or hide a UI element.
String
substring(s, start, len) -> string— Slice of a string.split(s, sep) -> array— Split a string into parts.replace(s, from, to) -> string— Replace every occurrence.trim(s) -> string— Strip surrounding whitespace.to_lower(s) -> string— Lowercase.to_upper(s) -> string— Uppercase.starts_with(s, prefix) -> bool— String begins with prefix.ends_with(s, suffix) -> bool— String ends with suffix.
Persistence
save_set(key, value)— Persist a value.save_get(key) -> value— Read a persisted value.save_has(key) -> bool— Persisted key exists.save_delete(key)— Delete a persisted value.
Session
set_var(key, value)— Set a session variable.get_var(key) -> number— Read a session variable.add_var(key, delta) -> number— Add to a session variable.move_piece(dx, dy)— Nudge the bound piece (2D host).set_ambient(level)— Ambient light level.set_solid(on)— Make the bound object solid or pass-through.set_color(color)— Tint the bound object.set_tuning(key, value)— Override a tuning knob.revert_tuning(key)— Restore one tuning knob.reset_tuning()— Restore all tuning knobs.hide_self()— Hide the bound object.destroy_self()— Destroy the bound object.
Player
teleport_player(x, y)— Move the player instantly.impulse_player(x, y)— Push the player.grant_ability(name)— Give the player an ability.revoke_ability(name)— Take an ability away.kill_player()— Kill and respawn the player.win_level()— Finish the level.player_speed() -> number— Player's current speed.distance_to_player() -> number— Distance from the bound object to the player.set_player_scale(x, y)— Resize the player.get_player() -> go— The player object.player_overlaps_self() -> bool— Player touching the bound object?player_hit_underside() -> bool— Player bumped this from below?contact_normal_y() -> number— Y of the player's last contact normal.
Runner events (on name(args) { ... })
- awake() — after the script's top level runs
- start() — first frame
- update(dt) — every frame
- fixed_update(dt) — physics step
- late_update(dt) — after update, for cameras
- enable() / disable() — object toggled on/off
- destroy() — object is being destroyed
- trigger_enter(name, obj) / trigger_exit(name, obj) / trigger_stay(name, obj) — trigger volumes (3D and 2D)
- collision_enter(name, obj) / collision_exit(name, obj) / collision_stay(name, obj) — collisions (3D and 2D)
- controller_hit(name, obj, dx, dy, dz) — CharacterController hit something
Source in the box: Assets/ArTchie Studios/ArTchie-Bedder-Suite/com.bedder.script/MANUAL.md