[Solved]Change offset overlap in 1 mirrored instance...

Get help using Construct 2

Post » Fri Dec 18, 2015 12:52 pm

This is the link to the capx. Please download it and have a look if you may.
https://www.sendspace.com/file/44kj1r

This is bugging me out of my skull.

I am spawning 2 boxes each 3 seconds.
On is on screen left and one is on screen right.
Now both are the same instances of 1 box. The box on the left is mirrored once it is created.

I have an "offset overlapping" on the main box used to check the collision.

Now here comes the problem.
When I mirror the box on the left, the offset overlapping is not mirrored but remains on the same side that the orignal offset overlapping

How is is possible to change the offset so that its "offset overlapping" is on the opposite side in the mirrored box instance?

There are 2 conditions that I need to remain:
1) Both boxes need to be of the same object type, and they need to be 2 same instances like they are now.
2) The mirror must be done like it is now. Rotate 180 degrees cannot be used, because I need to use a complicated formula which has several different global variables: set X=self.x+....etc formula and not: move forward x+....

In other words it is the same problem I am having in most of my prototypes from the beginning while using Construct2, I cannot no matter what I do, change the value of 1 instance when the instance is created by events instead of being placed by hand.

I tried using families and the family instance variable, but changing that from the event sheed changes all the family instance variables for all the object which is really a shame, because if it was possible to manipulate some values of instances using family instances it would be a very very powerful feature.

If I change the family instance, all of the offset collision changes for all the instances in the scene.

I would be glad if someone help, so I can stop pulling out my hair.
Last edited by Solomon on Fri Dec 18, 2015 1:25 pm, edited 1 time in total.
Brick by brick, stone by stone.
B
56
S
25
G
18
Posts: 273
Reputation: 13,363

Post » Fri Dec 18, 2015 1:20 pm

I'm not sure if you understand overlapping at offset..
Because your example adds the x-position of the object to the value of the offset, it behaves strangely..
Offset is calculated from the current position of the object, so for my example I just used 200px..

https://dl.dropboxusercontent.com/u/485 ... ffset.capx
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 » Fri Dec 18, 2015 1:24 pm

@LittleStain
Yeah for the last 15 minutes it occured to me that something was off with the way I was using the offset value...
Thanks for pointing that out!

Next time Ill make sure to do some more reading on the function itself... :oops: and not waste peoples time.
Sorry for the trouble and thanks once again for the help, I appreciate it!
Brick by brick, stone by stone.
B
56
S
25
G
18
Posts: 273
Reputation: 13,363


Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 14 guests