How do I fix this custom movement

0 favourites
  • 11 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • Hi guys,a question about this this cool tutorial:

    https://www.scirra.com/tutorials/4859/s ... k-movement

    I have one BIG question... i am interested ONLY in the smooth movement...so the smooth scrolling one... why does my player sudenly go so slow...because its every thick ? Is anybody here who can make in the way that the speed is alwasy equal..and not changing according how far U r from the stick center ? thanks

    thanks

  • The "smooth scrolling" example in that tutorial is for precise scrolling with the stick, its speed depends on stick position.

    If you need constants scrolling speed, simply enable ScrollTo behavior for your character (the one controlled with the gamepad). The screen will always scroll with your character.

    If you want a smooth "inertia" effect, you can disable ScrollTo and add these events:

    On every tick

    -> System Set Scroll X to lerp(scrollx, Character.X, dt*8)

    -> System Set Scroll Y to lerp(scrolly, Character.Y, dt*8)

  • thanks, is ther another sode for a precise smooth movment of the character ( im not talking about the scrolling of the screen) ? somehow in my layout there are suddenly slowdowns...can I make my charater move with equal speed using somehow this code ? thanks

  • Not sure what you mean. The "8_Direction" sprite in the tutorial moves with constant speed. Its speed does not depend on axis value, only on axis direction.

    It's hard to tell what's wrong with your code without seeing it. Could you share the capx?

  • No, I mean this code: Part_2 Smooth Scrolling Movement

    I use that one for the space ship..not the 8_direction one.... The movement is perfect...but it slows down every 5-6 seconds for a few seconds...

    Maybe its also for the fact that pressing a bit the stick its a slower movenemnt..is there a other similar way ?

    thanks 4 ur help

  • Did you change anything in the capx from the tutorial? It works fine for me, does not slow down. It stops when meets layout borders.

    Please share your capx file.

  • hi, i have copied the entire 2 strings...+ all behaviors of the Smooth_Scrolling sprite + family behav....it seems that some how it "remebers"the few times i move a bit the stick to go slower...and keep that speed even I move on 100%.... is there any code that makes the speed equal ???

    Capx is 500MB

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • wait I send U a link of the capx

  • here is the file...if you move now arround...sometimes its slow..and suddenly very fast..how can I fix that ??? Or did I delete wrong codes ??? but only that refers to THIS sprite

    thanks..its sooo important for me

    https://lookaside.fbsbx.com/file/test%2 ... V-tdAP_l9Q

  • I don't know, maybe there is something wrong with your gamepad.

    Add Browser object, add "Browser->Log Gamepad.Axis(0,0)" on every tick.

    Run the game, press F12, move the stick all the way to one side, see what numbers you are getting in console when the movement slows down.

  • thanks 4 ur help..I think it was FIREFOX...on chrome no problem

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)