Author Topic: Problem on acceleration  (Read 4606 times)

rapickt

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Problem on acceleration
« on: August 18, 2014, 09:45:02 AM »
My game is on Android, it's a car game, and I have a problem with the accelerator pedal.
On mobile the car accelerate, but much slower than on PC.
I think it's the refresh of ngui.
I have a minimum of 250 FPS on PC
The speed value is inside the update and I call the value in a script.

The setting Time Manager :
Fixed Timestep 0.05
Maximum allowed Time : 0.1
Time scale :1

Any clue? I can't figure out why there is this problem on mobile, while it does works on PC. Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem on acceleration
« Reply #1 on: August 18, 2014, 12:28:22 PM »
How is this an NGUI support question?

rapickt

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Problem on acceleration
« Reply #2 on: August 19, 2014, 02:21:55 AM »
Since the accelerator is a UIButton of NGUI, this is NGUI related. The accelerator works well in the unity editor, but as soon as i build an APK the pedal doesn't work the way I want it to.

So what you are saying, is that my problem is in no way NGUI related, but the problem comes from my script. Am I right?

r.pedra

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 20
  • Posts: 131
    • View Profile
Re: Problem on acceleration
« Reply #3 on: August 19, 2014, 03:55:21 AM »
You probably increase your speed at each frame without using DeltaTime, so if you have less FPS, you accelerate less.
If your car doesn't accelerate as much as you want, it has probably no chance of being related to your button...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem on acceleration
« Reply #4 on: August 19, 2014, 11:19:22 AM »
What r.pedra said. You need to take Time.deltaTime into consideration. The problem is in your code and has nothing to do with NGUI in this case. NGUI is a UI library, while the issue is in your car movement code.