Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created December 8, 2024 11:02
Show Gist options
  • Save flushpot1125/4baf7f9b0f18303ebf2bbe1c1a7681eb to your computer and use it in GitHub Desktop.
Save flushpot1125/4baf7f9b0f18303ebf2bbe1c1a7681eb to your computer and use it in GitHub Desktop.
namespace PROJECT {
/**
* Babylon Script Component
* @class MyRotate
*/
export class MyRotate extends TOOLKIT.ScriptComponent {
// Example: private helloWorld:string = "Hello World";
public speed:number = 1.0;
protected awake(): void {
this.transform.position.set(0,1,0);
/* Init component function */
}
protected update(): void {
/* Update render loop function */
const deltatime:number = this.getDeltaSeconds();
const turnSpeed:number = this.speed *deltatime;
this.transform.addRotation(0,turnSpeed,0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment