How to make an object spin

ill be idle for some time for lunch, i’ll be back after though

Ok and yes this would be correct but there is some minor changes to make

if(this.app.keyboard.isPressed(pc.KEY_E)){
     this.entity.rotateLocal(X,Y,Z);
}

You can check out the user manual as well for more info on different types of coding. If it does not help then ask the forum.

https://developer.playcanvas.com/en/user-manual/

ok

why is there 2 X’s and no Z?

I updated the code of @Mason_Rocchio.

[lean.js?id=105750582&branchId=9b8657bd-919b-481e-b636-7414213eb40b:8]: Uncaught TypeError: Cannot read properties of undefined (reading ‘keyboard’)

what do I do now??

nevermind

Hi. I was trying to spin my “chair” (render-type object), and I tried all the scripts from this topic, but it didn’t work with me. Please help, I need a working response until tomorrow. I put the project and a screenshot of what I have. Thanks.


https://playcanvas.com/project/1463965/overview/apple-ichair-concept-spinning

in the spin script is the latest developer response (3y old)

Hi @prodbydavafacters and welcome!

The script component on the chair entity is currently disabled. Please enable it.

Also make sure your script changes are saved, otherwise they will not be applied yet.