Please guys, I need your help !

Get help using Construct 2

Post » Sat Jul 18, 2015 2:30 pm

Hi Guys,

I finishing my physics based game, but there is only one problem in this game.
All objects haves the physics behavior, including the main character. At some stages there is some blocks with the sine behavior, so, when the player falls at these blocks, the blocks naturally starts to move the play (similar to an elevator platform). But there is a problem: sometimes, something happens and the player bugs and he stay fixed at the screen (maybe because there is no gravity in physics behavior, I think" and the "side-elevator" platform continues moving.

I will finish my game today, I must only fix it!


Thank you guys, I hope it is not to much confuse.
B
5
S
1
Posts: 60
Reputation: 495

Post » Sat Jul 18, 2015 2:33 pm

You need to add a .capx file, even a small sample of what you are trying to do.
B
86
S
25
G
11
Posts: 652
Reputation: 11,051

Post » Sat Jul 18, 2015 2:36 pm

Sometimes something happens?

When does what happen?
he stay fixed at the screen means that the player doesn't move?
Is the player overlapping something?
Are you using the collision polygon of the animated player for the physics or do you have a detection sprite?
Could the issue be that the collision polygon changes and as such the player suddenly overlaps the platform and gets stuck?

A capx with just an example of the issue would help a great deal..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 18, 2015 2:54 pm

Hi Guys, thanks for the help!

I made an example capx for you ! the game is not working in this example, is just to show you the bug.

You only need to wait and see what happens with the character.

Link: http://www.mediafire.com/download/pypav ... ample.capx

Thx
B
5
S
1
Posts: 60
Reputation: 495

Post » Sat Jul 18, 2015 3:07 pm

You generally can't mix Physics with other behaviours.

From the manual:
Manual movement & other behaviors
If you move objects by events (e.g. set X, set Y) or other behaviors (e.g. also adding 8 direction to a physics object), the physics simulation will do its best to keep up with what you've done. However, it is usually more realistic to achieve the same thing by applying forces and impulses to physics objects. This keeps everything "in the physics world" and realistic.

For example, if you use Set Position to move an object to the other side of the layout instantly, it has effectively teleported. That's not a realistic physical phenomenon, so the result may be unrealistic as well. To keep up, the physics behavior will spot this, and simulate the object suddenly moving extremely fast towards its destination point for one tick (about 1/60th of a second). That's an incredible amount of acceleration, speed, then deceleration. Remember, to keep a simulation stable, you should avoid extremes.

Although you can add the Platform behavior to a Physics object, the two tend not to get along very well. Again, it's better to achieve the same thing by applying forces. See the Physics - rolling platformer example provided with Construct 2 for a demonstration of how you can achieve this.

viewtopic.php?f=152&t=70973
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Sat Jul 18, 2015 3:19 pm

Hi BlackHornet, thanks for your reply!

I understood your comment, but I didn't get exactly how I will fix it by using platform behavior and make it appear "natural"

I don't know if you check my capx example, but I will be happy if you can give me a code example of how can I fix it.

Thanks!
B
5
S
1
Posts: 60
Reputation: 495

Post » Sat Jul 18, 2015 4:36 pm

Please, can anybody help me? *.* I only need to fix it to publish my game.
B
5
S
1
Posts: 60
Reputation: 495

Post » Sat Jul 18, 2015 4:40 pm

Ok very simply put:

Remove the sine behaviour and try to replicate it using physics..

Having both behaviours gives unexpected and unwanted results as you have noticed..
Either make everything physics or fake the physics parts with other behaviours, movements, events and actions..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 18, 2015 5:44 pm

Hi @LittleStain, if I remove the sine behavior, how I can do the auto movement of the blocks?
B
5
S
1
Posts: 60
Reputation: 495

Post » Sat Jul 18, 2015 5:50 pm

why you just use the solid behavior instead of physics in the blocks? and keep the sine behavior, in my game i use also blocks with the sine behavior and i add solid behavior to them so the player can stay over the blocks, all work fine for me
B
21
S
8
Posts: 86
Reputation: 1,671

Next

Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 9 guests