Using something like nipple.js in a project

I’ve just started out at Playcanvas. I’ve got the hang of the editor but I have little knowledge about scripting. As my first project I want to create a touchscreen controller for the MyFirstProject Ball game. Looking at example projects showed me that I really need to learn JS to even be able to get something like that done.

When looking for solutions I found NippleJS which seems like a fantastic script with versatile and understandable output. However with many components to this script what would be the best way to incorporate something like that into my project? Would I need to alter a lot to get it to work with components that are added through the Playcanvas editor? It would seem that there isn’t anything to attach to an entity like I’m seeing in many similar projects.

Any suggestions, reading material or example projects are highly appreciated!

This project has a first person controller with integrated virtual joysticks:

You shouldn’t need to resort to using something like NippleJS.

1 Like

Thank for pointing that out. I did find your project earlier but thought scripts from other projects would be easier to implement (plus, I’m trying to have a permanently visible ‘joystick’). However, using it now I’m getting close to my desired result and I can see that your script is very elegant and understandable.

From here I should be able to get everything working the way I would like. But if you have any tips on integrating the ‘apply force to ball’ type of movement from the keyboard controls of the starter project into your script or how to get the permanently visible ‘joystick’ that would be wonderfull!