Animations
Quick Links:
Avatar Animations
We utilize the Mixamo (opens in a new tab) FBX format for our avatar animations. You can download any animation from Mixamo and upload it to our platform. Additionally, we offer a repository of animations for you to explore in the studio.
1. Downloading and Uploading Animations:
- Visit Mixamo, choose an animation, and download it in the .FBX format.
- In oncyber Studio, navigate to the avatar section on the left, then select Avatar Animations.
- Upload your animation and rename it for easy access later (either in the avatar menu or through scripting).
2. Implementing Avatar Animations in Scripting:
import { Components, Player } from "@oo/scripting";
export default class Game {
onReady = () => {
// Animate an avatar within the scene
const avatar = Components.byId("AvatarID");
avatar.animation = "chickendance";
}
}
Animating Objects on the Screen (Position, Rotation, etc.)
To smoothly update the position of an object in the scene, use AnimeJS:
import anime from "animejs";
onReady = async () => {
const bus = Components.byId("bus");
anime({
targets: bus.position,
x: -10,
y: 0,
z: 0,
duration: 1000,
});
}
AnimeJS offers a variety of options. For more details, refer to the Anime.js documentation (opens in a new tab).
General Model Animations
To play or pause animations on a 3D model using scripting:
import { Components, ModelComponent, seconds } from "@oo/scripting";
export default class Game {
onReady = async () => {
const model = Components.byId('samplemodel') as ModelComponent;
model.play("GM");
await seconds(10);
model.stop("GM");
}
}