I want to know if there is a way to check if the number keys or mouse clicks are clicked. I don’t want to use buttons that are to far away from the player’s hand so they could reach it easily.
Hi @Sparsh_Chandra,
Here is the list of keys that you can use in Typescript. In your case maybe is good to use the right or middle mouse button. An example code with letter “z”:
const zebra = Scene.getItem("Zebra") as AnimatedItem;
function zdance () {
zebra.speech = null
zebra.animation.playLooping('Dance');
}
Input.onKeyPressed(() =>{zdance()},"z")
In Basics TypeScript 7 you can find more such examples.
Hope this can help,
greetings pavlina
1 Like
Ok, Thank You so much I will try this, but is there a way to achieve this is coblocks because I don’t really understand how Typescript works.
No, this list in Co Blocks is quite limited,as far I can see. So please take a screenshot or share the Co Space if you can. I’ll write the Typescript for a small part, like an example, and then you can implement it anywhere you need. It’s simple and it can be easily combined with CoBlocks in a new window.