How do I reduce the lag?

Is there a way to reduce the lag after I run my code (CoSpaces Edu: Make AR & VR in the classroom)
The variable [LagTest] is for testing will the running of variables affect the performance
(if you re-enable it, u can see that it will be slower than the original one)
In the spin, there is clearly a stop after the first spin happened
Is there a way to make it smoother?

Hi @TerribleAtCoding,

It looks like you’re using a private link to your space that only you can access. Can you please provide a share link to help us review your performance problem? :slight_smile:

Oops, my bad, I will do that tomorrow, sorry

does that work?

Refer to these links,

Hi @TerribleAtCoding,

Firstly, I think you should change your username - you’re learning to code, as we all are.

Secondly, from my perspective, you have a change of direction midway, not a stop. If you use Chrome web browser, make sure hardware acceleration is enabled: Tip: How to make CoSpaces Edu run faster in Chrome - YouTube

Thirdly, what is the camera movement you’re wanting to achieve? There are a number of different ways to achieve the same movement or similar.

Here’s a slightly more efficient version:

Hope that helps! Let me know if you have any further questions.

Geoff @ TechLeap

Oh thanks
I’ve tried to run yours as well, but I can still feel the sudden moment of stopping after it turned the first 90 degree…

I had hardware acceleration enabled as well
Is it just because of bad computer?

I don’t think so. I believe it’s because the move back in the other direction is quick, without any pause.

See this remixable CoSpace - you can see the path of the camera, and this might help you to understand how the camera is moving a little better:

Also, the turn to look at object block only rotates your object on the Z-axis. If you want the camera to always look at the dog, use turn to look at XYZ and put the position of dog block in the XYZ parameter. I’ve done this in the above CoSpace - change the main camera so you can see the difference.

Hope that helps! Let me know if you have any further questions. If this solves your problem, please mark this post as the Solution.

Many thanks,
Geoff @ TechLeap