Colliding Issue when actor changes image

DaGreatnessDaGreatness Member Posts: 82
edited November 2013 in Working with GS (Mac)
So the issue i am having is, that i have an actor that collides with another actor which increases the health, also i have a charcter select screen where you choose the different actors. When I choose a different actor to play with from the select screen, the actor in the game with the different image does collide with the object but the health does not increase, it collides but does not increase the bar back up, but when i do it with the startup character which is the first image which is already on the actor it seems to work.

My actor has all the rules in one, so its just one actor with different images. Which i do not get why when the second image is changed, it collides with the item but it will never increase the health, is there something i am missing when you change images? with using the same actor and the actor rules?

Also, If i try to collide more than once, it still does not change the health bar ratio. I will insert the 2 actors rules down below.

Character Actor:
RULE
actor overlaps or collides with: actor of type->gaspump
If game.gaspower < 50
DO
Constrain Attribute: constrain game.gaspower to game.gaspower+10

HealthBar Actor:
RULE
If game.startgas is true
DO
Interpolate self.size.width to -1 for game.gaspower

Outside the rule
Constrain Attribute: constrain self.position.x to 13+(self.size.width/2)


gaspump Actor (this is what the actor will be colliding with to increase the health points):
RULE:
IF game.gaspower < 10
actor overlaps or collides with actor of type:gasPump
DO
constrain attribute: constrain game.gaspower to game.gaspower+10

RULE:
actor overlaps or collides with actor of type:body
DO
Timer: after 0 seconds Run to completion (Checked)
Destroy this actor

This is what i have, and you can recreate it to see

So if i have like 4 gaspumps they will all collide with the body, but will not increase the healthbar for some reason

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    I can't understand what you wrote. Maybe you can re-read it and see if it makes sense the way you wrote it. If not, revise it and I'll see if I can lend a hand.

    Edit: I struggled through it and I see what you're asking. In the future, part of the reason no one responded might be because it was hard to read.

    Either post your collision rules or send a link to download your project file. Images should not affect collisions or other rules.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • DaGreatnessDaGreatness Member Posts: 82
    @tatiang, sorry about that, i have reposted and edited the main post with everything in it for you to see.
  • DaGreatnessDaGreatness Member Posts: 82
    @tatiang I MANAGED TO SOLVE THE ISSUE AFTER BUSTING MY HEAD FOR 2 DAYS!!! THANKS FOR LOOKING INTO IT MY FRIEND!!!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yay! What was the problem?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • DaGreatnessDaGreatness Member Posts: 82
    There was an attribute, which was outside the rule which was messing up, once i brought it into the rule it worked like a charm!
Sign In or Register to comment.