How can I make this chariot work properly ?

0 favourites
  • 11 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • Hi. I reproduced here an example of what doesn't work in my original project:

    1) I have some chariots that are composed of multiple parts, and I want all the parts that have the same number in the instance variable called "nr" to be pinned properly.

    2) When the player is pushing the chariot and then stops, but he is still overlapping with the chariot, the wheels are rotating.

    How should I solve this ?

    https://www.dropbox.com/s/6axmysn7xfn47 ... .capx?dl=0

  • Is the animation you are pinning a loop?

  • I don't understand the question.

  • Can't tell a solution of the current algorithm, but you may try this as alternative, works pretty smooth:

  • I can't open your CAPX because it has an add-on.

    You are using overlapping so check your collision boxes. If I understand your problem you want the wheels to stop turning when the box is no longer overlapping the center of the wheel and that looks like a collision box problem.

    Make that collision box on the wheel very small and it should work. You can also adjust the collision box on the box you move to be smaller to end the overlap sooner.

    EDIT: Sorry I am looking at Myrmex gif and thought it was your example but still check your collision boxes when using overlap as a trigger.

  • I have not explained correctly, apologize for this <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Myrmex Thanks. I followed your example but not to achieve that. I wanted the chariot to be one piece, and I've manage to do so.

    https://www.dropbox.com/s/ypdyc9ji5fikpw6/chariot.jpg?dl=0

    lamar I added a version without the litetween plugin, it should work now.

    Now remains the issue where the player is pushing the chariot and when he stops the wheels keep rotating.

    Please have a look:

    https://www.dropbox.com/s/vxzs68wcllgsl ... .capx?dl=0

  • I think "else" condition refers just to the last event's conditions of the same level - so if PlayerOverlapper weren't overlapping ChariotBoxMovable and Player weren't on the floor it would work.

    You can stop wheels from rotating e.g. this way:

    https://www.dropbox.com/s/ifp6ev2wwmons ... dition.png

  • bambo Hello. I tried it and ot almost worked <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> . The issue now is if the player pushes the chariot and then jumps over it and goes on, but keeping the A or D pressed, wile doing this, the wheels are rotating. <img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral">

    I've tried different things but is the same .

    https://www.dropbox.com/s/pigex15bqhev4 ... 3.gif?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can add another event like this:

    http://www.dropbox.com/s/a5wh3aexmd36pm ... ition2.png

    It should solve this problem <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> Frankly speaking I think you should contemplate the way you organize your events - e.g. it's unnecessary to set rotate speed of wheels every tick (what happens in your case when player is pushing boxes). As a result the events I've added to make it working are also not that correct - it would be much better if you design this event system which would allow you to set rotate speed to 0 only once - when A key is released. You will achieve what you want in your way but it's just my little tip for future projects <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

  • bambo You solved the issue where player jumps, the wheels are not rotating anymore. But if the chariot hits a wall while the player is pushing it, the wheel are rotating until the key A/D/W is released. I tried with "Platform has wall to right/left" but it doesn't work. You are probably right, I should think to another way of doing this. Thanks again.

  • Solved. For those who are interested of doing something similar, here is the link

    https://www.dropbox.com/s/vxzs68wcllgsl ... .capx?dl=0

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