Created
December 8, 2024 11:02
-
-
Save flushpot1125/4baf7f9b0f18303ebf2bbe1c1a7681eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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