Adding interactivity to SVOYA interior (Playcanvas/WebGL). Part 4
This is part 4 of the 5 series of tutorials on adding interactivity to the SVOYA Apartment interior.
Access to materials, such as: models in the "FBX" format, baked textures, scripts and more, you can get by subscribing to Patreon.
PatreonView the Playcanvas project online.
View Playcanvas Project OnlinePractice shows that on mobile devices for orientation and movement in 3D space, the most convenient and effective way is to use a virtual joystick. Don't believe? Try it yourself!
The double-tap-and-drag option is only part of the experience, doesn't deliver the full immersion effect, and doesn't convey the unique user experience that a virtual joystick can deliver.
If you want your project not to look like a regular panorama tour and you want your client to get real pleasure from interacting with your scene, then the choice is clear - use a virtual joystick! It will help you feel like a real participant in the virtual world and create an unforgettable experience.
The joystick was taken as a basis from an example lesson on the official website of Playcanvas.
Touchscreen Joypad ControlsThe only difficulty was that the virtual joystick scripts were adapted for Third Person, and we needed it for First Person. Therefore, in order not to change anything in the current project, I finalized the scripts from the lesson and adapted them for such a type of project as SVOYA Apartment.
The joystick was created using the Playcanvas UI system.
All graphic elements were taken from the Playcanvas Manual.
To do this, go to the scene of this lesson.
Scene - Touchscreen Joypad ControlsAnd copy the “touch-joypad” folder into your project. If you are a Patreon subscriber and have access to the SVOYA Apartment project, I recommend copying the folder from there.
Next, create a new “Entity - 2D Screen” in “Hierarchy” in the “UI” folder.
Then from "Assets" in the "touch-joypad/templates" folder drag the two joystick template elements: "Left Fixed Touch Joystick" and "Right Fixed Touch Joystick".
An example is shown in the screenshot below.
Everything, these are all the graphic elements that needed to be added. If you now run the project (“Play”), you will see that even the Desktop version has these virtual joysticks.
Add the following scripts to the "touch-joypad/scripts" folder with replacement.
Script "joystick-camera-orbit.js".
Script "joystick-player-movement.js".
Modified "touch-joystick.js".
The scripts “joystick-camera-orbit.js” and “joystick-player-movement.js” were completely written by me to adapt the virtual joystick to the current “firstPersonMovement” script for “Player”.
Apply the "joystickPlayerMovement" and "JoystickCameraOrbit" scripts to our "Player" with the following settings shown in the screenshot below.
Important!
Apply scripts only to “Player”. DO NOT apply scripts to “Camera”!
Select our "Right Fixed Touch Joystick" and apply the "touchJoystick" script, with the following settings.
Now select the "Left Fixed Touch Joystick" and also apply the "touchJoystick" script with the following settings.
Ready! You can run the project (“Play”) and enjoy the virtual joystick for the mobile version of the project.
Please note that the speed of movement of the “Player” or the rotation of the camera depends on how far the joystick stick is deflected. I had to sweat a little to make such a smooth functionality, because with ready-made solutions, for example, with the slightest shift of the stick, the player immediately gained maximum speed, which was not very comfortable.
I hope you appreciate my efforts and subscribe to my Patreon.
PatreonAnother important point is to show users on mobile devices that they need to flip the device horizontally to use the joystick.
Add a new "Layout Group" to "2D Screen". Name it "RotatePhone".
Then add a new UI element “Button” to “RotatePhone”, name it “Background”.
Background button settings.
As a texture for "RotateImage" load and select the following image.
With the following settings.
Select “Left Fixed Touch Joystick”, and in “touchJoystick” script, apply “RotatePhone” as “Entity” in “Rotate Phone UI Entity” setting.
Run the project on mobile. Now you will see a picture showing turn the phone to landscape position.
And in a horizontal position, you can move around the stage with a joystick.
And here is the end result.
View Playcanvas Project OnlineIn this exciting part of our tutorial, we added a joystick for mobile devices and made it so that everything was done according to the rules and at the highest level. You will be able to use the scripts and principles learned in this tutorial in your future projects and delight your customers with an amazing user experience. You will definitely be above your competitors using such techniques and knowledge!
Patreon subscribers will be able to view the SVOYA Apartment project in read mode, as well as quickly copy-paste the necessary assets and scripts into their personal project.
For everyone else, you will find everything you need on the page of this lesson.
PatreonFAQ
1. What is this article about?
2. What is covered in Part 4?
3. Do I need to complete the previous parts first?
4. Why is interactivity important in architectural visualization?
5. Can these techniques be used in other PlayCanvas projects?
6. Does Part 4 focus on user experience improvements?
7. Can custom interface elements be added?
8. Is it possible to extend project functionality over time?
9. Can users interact with scene objects in real time?
10. How important is optimization at this stage?
11. Can the project remain compatible with mobile devices?
12. Is PlayCanvas suitable for commercial presentations?
13. Do advanced features require programming knowledge?
14. Can interactive projects be updated after publication?
15. What advantages do interactive WebGL presentations offer?
16. Who should read this article?
Vasyl Lukianenko is a 3D artist and technical author focused on practical workflows, optimization, and production-ready techniques. He publishes tutorials, courses, and tools to help artists work faster and get cleaner results.
All posts by this author















{{comment.text}}