How to create wall?

chosenonestudioschosenonestudios Member Posts: 1,714
edited November -1 in Working with GS (Mac)
I know you can create "walls" by using the collide attribute, but its not working for me....

Basically its set up so:

when touch is pressed: constrain mouse x to self position x and same for y values.... That works great, but theres no colliding going on.... My wall is set to not move (as walls shouldn't) My actor just goes right through it...

This might seem really simple to some of you, and I might feel stupid after I know how to do it, but I cant for the life of me figure it out haha!

Anyway, Thanks in Advance!

Comments

  • KamazarKamazar Member Posts: 287
    So you're having an actor constrained to your touch? Up the density on the wall.
  • iDeveloperziDeveloperz Member Posts: 1,169
    You just add the collide behavior in the actor you want it to collide with the wall.

    Then set the collide to actor o type wall.

    :)
  • chosenonestudioschosenonestudios Member Posts: 1,714
    @kamazar yeah just tried that didn't work, it still goes right though it when moveable is unchecked and when its checked it "collided" but it moves all over the place, Which I can't have..... even when the densities at 1,000,000.

    @iDeveloperz...... yeah used that and it didn't work (see previous post)
  • iDeveloperziDeveloperz Member Posts: 1,169
    Woah you put an s, it's a 'Z'!!!!

    Anyway It should work. Is the resperority (I can't spell) set to 0?

    Also make sure the collide is not put in a rule, common mistake I do.

    And finally If you have changed the actors prototype then whatever you add in the original actor will not appear in the actor you have edited.

    :) They are just common mistakes I do. Maybe some other people here do it but work it out instantly.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Woah you put an s, it's a 'Z'!!!!
    No I didn't haha jk fixed now my b
    Anyway It should work. Is the resperority (I can't spell) set to 0?
    yeah the restitution is 0
    Also make sure the collide is not put in a rule, common mistake I do.
    not in rule
    And finally If you have changed the actors prototype then whatever you add in the original actor will not appear in the actor you have edited.
    no prototypes
    :) They are just common mistakes I do. Maybe some other people here do it but work it out instantly.

    I think it has something to do with the constrain of the actor, Im not sure though because I've got this to work with other things, just not constraining....
  • chosenonestudioschosenonestudios Member Posts: 1,714
    anybody?
  • expired_012expired_012 Member Posts: 1,802
    Im not too sure if this applies to your situation, but this is how I set my collision:

    So I have my main actor and an invisible wall. In the invisible wall I put the behavior "collide" and (Bounce when colliding with actor of type) and then I put the other actor that I wanted it to collide with. I then set the restitution of both actors to 0 and made the invisible wall unmovable and everything worked fine.

    Hope this helped!
  • iDeveloperziDeveloperz Member Posts: 1,169
    Sorry I went out. Can you upload your project so I can see what you are trying to do?

    If you don't want to I understand.

    :)
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    ive had the same problem in the past. never found an answer to it.
    what you can do tho constrain a limit to an actor. (do this only if you need few actors to be blocked by a wall)
    what i mean is:

    Then make a rule saying when attribute self.positionX </> 32
    constrain attribute self position to 32

    that blocks an actor from moving further.

    im not sure weather this helps because it doesnt affect multiple actors. this is just incase you only have 1-3 actors which need it (MAXIMUM)

    good luck
  • chosenonestudioschosenonestudios Member Posts: 1,714
    @artonskyblue, yea I've been able to do that, but unfortunately that seems to not work in this case :(

    @iDeveloperz Its cool, if I still can't get it to work I'll upload it :)

    @giacomopoppi thats unfortunate :( I think its probably a problem with GS though :/
    Thanks for the tip! I didn't think to do that :) One little problem though, after it stops it you can release it and then you can pick it back up and drag it over, when you set it down it'll go back, but you can still go by....

    Thanks guys for all your help!

    Edit: Also, it gets stuck on the wall and you have to let go move it again...

    Ugh is seems GS isn't meant to do this :/
  • firemaplegamesfiremaplegames Member Posts: 3,211
    @chosenonestudios:

    Constraining an Actor will override all collisions.

    So you can't use other Actors to set limits, like giacomopoppi said, you will need to add Rules to your Constrain.

    Your Rule set will need to be set up something like this:

    Rule
    When all conditions are valid
    Touch is pressed
    -----Rule
    -----When all conditions are valid
    -----selfPosition.X < [left limit]
    ----------Constrain self.Position.X to [left limit]
    -----otherwise
    ----------Rule
    ----------When all conditions are valid
    ----------selfPosition.X > [right limit]
    ---------------Constrain self.Position.X to [right limit]
    ----------otherwise
    ---------------Constrain self.Position.X to Touch.X
    -----Rule
    -----When all conditions are valid
    -----selfPosition.Y < [bottom limit]
    ----------Constrain self.Position.Y to [bottom limit]
    -----otherwise
    ----------Rule
    ----------When all conditions are valid
    ----------selfPosition.Y > [top limit]
    ---------------Constrain self.Position.Y to [top limit]
    ----------otherwise
    ---------------Constrain self.Position.Y to Touch.Y

    I didn't test that, it's just off the top of my head, but something like that SHOULD work..
  • chosenonestudioschosenonestudios Member Posts: 1,714
    @firemaplegames thank you for your help :)

    I tried what you did, but it didn't work... Well it did, but not exactly what I want it to do haha

    Heres what happened.. When it hits one of those limits it travels back and forth between the limit and the mouse position really fast...

    Any suggestions?

    Thanks in advance :)
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Anybody figure out how to do this?
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Anybody?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Check out the Volume Slider Demo on my wall. It does what you want - but only in one direction. You will have to add the Y axis!

    It sets limits without using collision.

    Dig through it and see if you can use it.
  • expired_012expired_012 Member Posts: 1,802
    how are you able to download other peoples demos? when you click download project it always goes to this web version of the game. Why is that?
  • chosenonestudioschosenonestudios Member Posts: 1,714
    thanks Joe! I appreciate it!

    @artonskyblue when you open GS, you see new project, recent projects, shared projects etc. click on shared projects, search for what you want then click on the pencil and kabam you got it:)
  • expired_012expired_012 Member Posts: 1,802
    thanks!
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Problem is officially solved :) Works flawlessly, alot of constrains, but it works Thanks Joe!

    @artonskyblue np:)
Sign In or Register to comment.