i have added Touch Rotate Node on character nodes direct connection with Start node it's work fine on Game Preview but When i export my game to android or ios and test it on real device, Touch Rotate method disappear as if I never add it.. So, is there anyway to build this method without using Touch Rotate Node ? or fix this bug ? Buildbox 3.1.4....
I am facing the exact same problem, and this is a huge issue I hope someone can come up with a solution.
Weird, it should still work when exported. Other control inputs might override it, if used. Send in your .bbdoc to support@buildbox.com, so we could take a look at it. You could try connecting the rotate node using a full screen or bottom of the screen UI button.
Already use everything possible and nothing worked But i change the touch rotate node script to anther rotate node found it on interstellar strike temp and it works here is the script /// let enabled = false; let scrX, scrY; let start, prev; let phys; let isTouched = false; let forward, right; let delta = new Vec3(0, 0, 0); let sens; function init() { this.enableTouch(); smooth = this.attribute('Smooth'); smooth = Math.max(0, Math.min(0.99, 1 - smooth)); sens = this.attribute('Sensitivity'); if(this.attribute('Invert X')) sens.x *= -1; if(this.attribute('Invert Y')) sens.y *= -1; scrX = Number(this.attribute('Screen X')); scrY = Number(this.attribute('Screen Y')); forward = new Vec3( scrY == 0 ? 1 : 0, scrY == 1 ? 1 : 0, scrY == 2 ? 1 : 0 ); right = new Vec3( scrX == 0 ? 1 : 0, scrX == 1 ? 1 : 0, scrX == 2 ? 1 : 0 ); phys = this.entity().physics(); sens = sens.scale(0.025); if (phys && phys.type() != 'kDynamic') { phys = null; } } function update(dt) { if(!enabled) return; if (phys) { addAngVel(delta.scale(smooth)); }else{ let ent = this.entity(); let nPos = ent.rotation().add(delta.scale(smooth)); ent.setRotation(nPos.x, nPos.y, nPos.z); } delta = delta.scale(1 - smooth); } function signal(name, value) { enabled = value; } function getVelFromScreenMove(dx, dy) { return forward.scale(dy).add( right.scale(dx)) } function addAngVel(vel) { setAngVel(vel.add(phys.angularVelocity())) } function setAngVel(vel) { phys.setAngularVelocity(vel.x, vel.y, vel.z); } component.touchBegan = function (pt) { isTouched = true; start = pt; prev = pt; } component.touchMove = function (pt) { if (!enabled) return; let dx = sens.x * (pt.x - prev.x); let dy = sens.y * (pt.y - prev.y); let vel = getVelFromScreenMove(dx,dy); delta = delta.add(vel); prev = pt; } component.touchEnded = function (pt) { isTouched = false; }
No NO absolutly no there is default touch rotate node on Control nodes and it works fine on game preview but not when export, the custom one works with no issues and Touch Node > Rotate Node doesn't work like touch rotate node....
hey man i was trying this out but i am getting this error: JS Error [asset: Cube, component: Script, line: 0] - TypeError: sens is null I am a noob can't figure out why i get this. can you help me?
I am also using the already built in touch rotate node but it does not seem to work outside of Bb3 environment. I already seen some other discussions about it in the forum https://www.buildbox.com/forum/index.php?threads/touch-rotate-node-bugged.18380/
Yes sorry, I overlooked the first post, but mohamed awad I'm glad you were able to get it to work. I'll still bring this issue up to the team.
NP bro, i hope they solve it quickly, i have already contact with support about anther bug and still waiting....
mohamed awad ladies and gentelman we got a genuies. i solved the problem it was just connected wrongly. I am so glad that you share your solution, it was great help for me and lots of others I guess. cheers!