Rotating an object with mouse

pls, i need help to rotate my scythe to the mouse.

Hi @jus.co_ding_me_23,

Check this example:

https://developer.playcanvas.com/en/tutorials/rotating-objects-with-mouse/

i still dont get it @Leonidas, i put the code and it does not work.

https://launch.playcanvas.com/1037267?debug=true

this is my game, pls help

If you mean the object doesn’t rotate, I don’t see in your project any code to so. It seems the script is missing:

image

i removed the script because it was not working

How to add tweet effect to this example,thank you?

What do you mean by a tweet effect?

sonrry,is Smooth rotation

You can do what the orbit camera does on the model viewer which is to lerp to a target rotation which gives you the inertia like effect I think you are asking for. E.g https://playcanvas.com/editor/scene/1058295

If there is no user input, you could use the tween.js library https://developer.playcanvas.com/en/tutorials/tweening/

thanks!