AR rotate and resize object

is it possible to rotate an object? PlayCanvas | HTML5 Game Engine. i tried to add touch input but it’s doesn’t woriking

Hi @Dann,

Take a look at this example, it uses mouse input. You can add touch input events similarly:

I tried but still can’t.

This example includes touch events, I’ve just tried it on my phone and it works as expected:

    if ( {, this.onTouchStart, this);, this.onTouchMove, this);        
TouchInput.prototype.initialize = function() {
 if ( {, this.onTouchStart, this);, this.onTouchMove, this);        

I’ve try this still can’t rotate. i try put the script on character and pattern maker still can’t

Yes, it’s not enough to copy/paste, most likely some changes will be required to adjust it to your project.

If you are able try sharing a project link to take a look.

here’s my project

Here you go, I’ve updated your project to being able to rotate the character on the marker:

Things I did:

  1. Added a pivot entity parent entity to the character, so I can rotate the character without messing with the AR placement.
  2. Fixed your rotate script to include an entity.rotateLocal() statement. Touch input was working correctly, you just didn’t go all the way to actually rotating the character.
1 Like

thanks now it works