Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
WASD keys android character keeps moving!

shadynl
Registered User
Quote
2017-01-10 16:28:30

hi all,

im working on a FPS shooter for android.
instead of using the touch screen input (4way controller stick) i have set them up as 4 seperate buttons: WSAD.....

problem: most of the time when i press A or D (and sometimes S) the player (FPS camera) keeps moving in that direction instead of making just 1 step....
when i move forward (W key) it does only 1 step as it should....

whats going on with this????

i need the seperate buttons WASD because i have setup a rule that when 1 of these buttons is pressed the gun starts moving like the player is actually walking.....

or i need another way to make the directional pad working with these same rules....

help needed:D


shadynl
Registered User
Quote
2017-01-10 18:51:25

any1 got an idea??

-testing WASD keys on android

- when A,S and D key are pressed the player just keeps moving in that direction instead of taking just 1 step....

when pressed ''w' the player does 1 step forward as it should be...

reall annoying issue...

hope this is explained clearly enough...




18:54 update: should i maybe emulate the Arrow keys instead of WASD? doubt it will help...

19:09 update: emulating Arrow keys has the same result... moving forward without problems, any other direction (left down and right) the player keeps walking in that direction... *sigh....


niko
Moderator
Quote
2017-01-11 09:36:57

Ah, interesting setup. It hasn't been intended to work like this, but it probably could. But as you write, it doesn't work that perfectly, as it seems. The usual "cursor key emulation" mode doesn't work for you?


shadynl
Registered User
Quote
2017-01-11 14:45:07

Yes the 4way cursor works fine and better then seperate buttons but i need to be able to set a rule in it to make my gun move when the player runs... did u check my latest youtube video? https://youtu.be/ZPxtkg1IG28

Right now i have setup a rule on the WASD key:

*If pressed (any of those WASD keys)

-make visibile 'gun animation running'
-make invisible 'gun animation shooting'

* if (any of those WASD keys') is released:

-make invisible 'gun animation running'
-make visible 'gun animation shooting'


I need to make this work for the 4 way cursor somehow....

I tried the option 'when mouse moved over' the 4 way cursor, but the android device does not seem to pick that up as touch input


shadynl
Registered User
Quote
2017-01-12 18:56:14

i have not found a solution so far, but i have to say so far the controls are really improved for android niko! nice job on that!


just_in_case
Moderator
Quote
2017-01-13 06:01:10

Thats very simple to solve , well i haven't read this thread before but the solution to your problem is pretty easy..

Just add a behavior when a key pressed do something, and add key 'A', and choose when the key left up .....now assign the action set animation of a scene node...set animation to idle..

Or if your fps has no animatio. You can use ccbaicommand javascript to stop the fps player...

Add the same behaviour fo other keys too... 'S', and 'D'....

And now when these keys will be emulated the player moves untill you left the touch....


Hope that work for you..


shadynl
Registered User
Quote
2017-01-13 14:13:27

Unfortunatly this assigning WASD or arrow keys does only work correctly under windows...
When u test on android and press A S or D the player keeps moving in that direction instead of taking 1 step... so 'when key pressed' and 'when key is left up' dont work really for the controls on android....

Now i have setup the 2d touch input for controls and that works but i need some way to make my run/shoot 'animation' (not really an animation) work...
So i have done it differently now....

Even if the player stands still the gun is moving like 'idle' ,same as when the player runs.... and if i hit the shoot
Button i hide that 'animation' and make the shoot 'animation' visible.
This is not the best solution but atleast it works...

So now if the player stands still the gun is moving as if he is running:(
I will posy another video later... so busy&128513;

Tnx anyway


shadynl
Registered User
Quote
2017-01-13 14:15:30

Do u have more info about this??? ccbaicommand???
Sounds interesting... is this to adjust how the fps cam/player should act?&128513;:)

I was looking for something like: if player stands still--- make a rule, that would do the trick to:)


shadynl
Registered User
Quote
2017-01-16 22:14:47

here is an update on my work:

https://www.youtube.com/watch?v=aQWG35g1KOE




i have added some weapons in this test:D
dont mind the green cursor, it looks weird on windows but perfectly on android...
i have filmed this with my iphone since screen recording laggs.
enjoy:D


is there any1 with an android device that can test the .APK and tell me why the camera is 'stuttering' sometimes??

i need your email adress then so i will send it trough the website 'wetransfer' its easy for sending files up to 2GB:D
i forgot my login for dropbox and im to lazy to figure it out:D

cheers!


just_in_case
Moderator
Quote
2017-01-17 13:30:12

Here is my email angelonghost@gmail.com

And you can get more info about ccbaicommand in coppercube documentation...


shadynl
Registered User
Quote
2017-01-17 22:02:05

u should have the downloadlink in your email now.
i hope u can tell me why the camera is acting weird on android...

tnx in advance!


just_in_case
Moderator
Quote
2017-01-18 06:48:50

Not able to download the file we trasfer just stucked on preparing files for download...


shadynl
Registered User
Quote
2017-01-19 03:23:14

Thats weird..i Have done that numerous Times and never had issues...
Anyway, i will Look into dropbox tomorrow. The camera issue is frustrating and makes me think a First person shooter can still not Be achieved as its supposed to:(
I Have set up the controls properly but still the camera Goes wild sometiMes...


shadynl
Registered User
Quote
2017-01-21 21:51:29

ok here are the links:

APK: https://www.dropbox.com/s/o6ixsfxtc9be3v9/FPS.apk?dl=0
CCB: https://www.dropbox.com/s/6sd5nh6jmrg4twl/FPS.ccb?dl=0

controls work fine on windows, but the problem is android...
i figured everything goes well untill after u have used the 'shoot' button.
after using the shoot button some times the camera goes wild when trying to rotate...

please tell me i did something wrong... if not this projects is a no-go....

kind regards!


shadynl
Registered User
Quote
2017-01-24 19:03:34

Did any1 test on android?

make this work and i'll deliver a great game this year:D:D:D:D:


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact