motion problem

0 favourites
  • 2 posts
From the Asset Store
Complete the collection by purchasing Motion Universe Pt. 2
  • hi friends ,

        i have a small problem, i have one car and i gave tooggle click for that car ,when clicking the angular velocity for that car is 680 and i gave 40 force at angle for that car, in destop it's working fine in mobiles it's working very slow , can any one of you please respond my question. please.

    dropbox.com/s/p7agja8wtjg93b6/click%20car.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're setting the angular velocity and applying a force every single tick - that's to say about 60 times a second.

    That's both on "Is clicked" and "Else". The PC probably manages the load while i suspect a mobile phone probably can't handle it that well.

    Also, are you using CocoonJS to port the game to Native first? Physics are extremely CPU consuming. CocoonJS uses an accelerated physics engine which increase FPS a lot on mobiles.

    Try to rework the events - maybe make them triggered?

    Like,

    On Left Button Clicked on Shape
    [ul]
    	[li]>if Clicked = 0 -> Apply Force/Velocity, Set clicked to 1.[/li]
    	[li]>if Clicked = 1 -> Remove Velocity, Set clicked to 0.

    Another variant would be

    On Left Button Clicked on Shape
    [ul]
    	[li]>if Clicked = 0 -> Set Velocity, Set clicked to 1.[/li]
    	[li]>if Clicked = 1 -> Remove Velocity, Set clicked to 0.[/li]
    [/ul]
    While Clicked = 0 -> Apply Force

    The first variant applies the force only once, whereas the second applies it every tick.

    Try those 2 and tell us if they work better.

    (BTW) Applying 0 force to an object does absolutely nothing at all, so no point in using that.

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