[SOLVED] Attribute problem

see my code

var MobileMovement = pc.createScript(‘mobileMovement’);

MobileMovement.attributes.add(‘player’,{type :‘entity’});

MobileMovement.prototype.initialize = function() {

MobileMovement.prototype.update = function(dt) {


MobileMovement.prototype.ontouchstart = function() {

but it does not work when i press the button, so long for my mobile game

i even made the player a dynamic with a collision

Hi @jus.co_ding_me_23,

Check if your element component has the Use Input property set to true in editor.

what is that?

it’s a boolean under the element component


use input is on

and it doesnt work

Start debugging your code, is it the callback not fired or maybe your applied impulse too small?

Add a console log and check in the browser console if your method is being actually fired:

MobileMovement.prototype.ontouchstart = function() {

it works, thanks @Leonidas

1 Like