[SOLVED] Rotating Obstacles

Can you share a link of your project please?

here
https://playcanvas.com/project/876716/overview/trigo-run

Hello

I think you did not understand what the others are trying to tell you, you have made some mistakes in your code.

1212

Here is your rotater.js script, here you can see that you have not replaced the name MyScript, it should be Rotater instead of MyScript otherwise you will get errors.

Then what you do is add a script entity to the object you are trying to rotate and then attach the rotater.js script to that object. Make sure you make the rigidbody of that object kinematic as static will not move and dynamic will not rotate properly because it requires forces.

Here is how it looks when I did a test (with rotationSpeed = 500).

1 Like

can you give me the project as a further example just for reference, also thanks for the video for it i really hope that it can work with enough effort because this is a major leap for the game if i get this working

thank you, also can you give me the project link for future reference, pls

Hello, I deleted the project from my account to save space.

Also I forgot to add your rotater.js script has 2 update functions, so you can put the rotation code inside the correct one and delete the MyScript function.

If you want you can give me write access to your project in Playcanvas my name is nasjarta, I can join you and explain how it works so you understand we can test.

1 Like

i can add you as a temporary admin so you can show me in the actual project, whats your playcanvas dev name

nasjarta

ok we’ll talk in the editor

you’re added

thank you nasjarta, also i am not deleting this post so other new devs can use this for reference, playcanvas devs please mark this as solved so people know that this can be done when they come across this post

1 Like