more questions! about friction and collisions and such
ok first some of the problems
i have push blocks in my game, these blocks should be completely non moveable unless you are pressing a push key
so without the key press you just bump into them and they should not even move a pixel
i tried doing this at first with the friction and density, and first off no matter what combo i used sometimes the block would still nudge like a pixel or 2 when i bump it, expecialy if i dropped off of a ledge onto it (my actor has yucky circle collison- because the rectangle collision gets stuck walking between simple platforms, even at exact height) if i landed off to the side of it the circle collision of my actor kind of pinches the box and makes it push even further. The second problem of trying to stop it moving by cranking up the friction and density is when i do have the push button held the object is so heavy it slows my pushing down!
I thought i had a perfect solution for this,
i made 2 actors one, is the push block (moveblock)with circle collision so it will go over gaps, and with physics set to make it push nice
the second was the same push block, set to non moveable with square collision (collide block)
i then set it where when my character gets within 5 pixels of a collide block, and has the push button pressed, the collide block is destroyed and a move block is placed in its exact location, then you can push the push block wherever, then when you release the push button, the move block is destroyed and the block is replaced with a collideblock.
this worked fantastic, i was in pushin blocks all over all happy. then i proceeded into other features of my game and discovered problems.
I have pressure plate buttons that are activated when you push blocks over them, these places open doors operate lifts, do whatever i need them to. the button is set to on collide or overlaps with collide blocks, or move blocks, set game.button true
i currently have it set to operate an elevator on the other side of the level. so i go to test i push the move block on the button, it lights up, the lift starts moving, then when i release push and it spawns the collide block the button turns off an the lift goes back down. it seems that since the collide block is spawning inside the button volume that its not triggering the button.
also another problem with switching the blocks to non moveable collide blocks is that if i push one on the lift it cant be raised.
--------------------
so the dirrect questions are
is there a way to make a object set to moveable not be nudged or pushed at all by characters, but yet have the character collide into them? i could do a magnitude and have the character stop a pixel or 2 away from the object, but that doesnt work when dropping off ledges onto them and such and seems like it would be a headache
any tricks to make a rectangle collision character walk over multiple actors without getting stuck on the edges between them (even with them perfectly lined up) one of the things i tried was setting the actor collision to circle, then constraining a box a few pixels smaller to the actor so it would have a flat bottom slightly lifted off of the ground plain by a bit of the characters round collision, but turns out constraining something kills its collision propertys.
i know i keep asking a lot of questions, i'm pretty new at game salad and the game i'm working on is fairly complex its coming along and i'm learning more and more. thanks!
i have push blocks in my game, these blocks should be completely non moveable unless you are pressing a push key
so without the key press you just bump into them and they should not even move a pixel
i tried doing this at first with the friction and density, and first off no matter what combo i used sometimes the block would still nudge like a pixel or 2 when i bump it, expecialy if i dropped off of a ledge onto it (my actor has yucky circle collison- because the rectangle collision gets stuck walking between simple platforms, even at exact height) if i landed off to the side of it the circle collision of my actor kind of pinches the box and makes it push even further. The second problem of trying to stop it moving by cranking up the friction and density is when i do have the push button held the object is so heavy it slows my pushing down!
I thought i had a perfect solution for this,
i made 2 actors one, is the push block (moveblock)with circle collision so it will go over gaps, and with physics set to make it push nice
the second was the same push block, set to non moveable with square collision (collide block)
i then set it where when my character gets within 5 pixels of a collide block, and has the push button pressed, the collide block is destroyed and a move block is placed in its exact location, then you can push the push block wherever, then when you release the push button, the move block is destroyed and the block is replaced with a collideblock.
this worked fantastic, i was in pushin blocks all over all happy. then i proceeded into other features of my game and discovered problems.
I have pressure plate buttons that are activated when you push blocks over them, these places open doors operate lifts, do whatever i need them to. the button is set to on collide or overlaps with collide blocks, or move blocks, set game.button true
i currently have it set to operate an elevator on the other side of the level. so i go to test i push the move block on the button, it lights up, the lift starts moving, then when i release push and it spawns the collide block the button turns off an the lift goes back down. it seems that since the collide block is spawning inside the button volume that its not triggering the button.
also another problem with switching the blocks to non moveable collide blocks is that if i push one on the lift it cant be raised.
--------------------
so the dirrect questions are
is there a way to make a object set to moveable not be nudged or pushed at all by characters, but yet have the character collide into them? i could do a magnitude and have the character stop a pixel or 2 away from the object, but that doesnt work when dropping off ledges onto them and such and seems like it would be a headache
any tricks to make a rectangle collision character walk over multiple actors without getting stuck on the edges between them (even with them perfectly lined up) one of the things i tried was setting the actor collision to circle, then constraining a box a few pixels smaller to the actor so it would have a flat bottom slightly lifted off of the ground plain by a bit of the characters round collision, but turns out constraining something kills its collision propertys.
i know i keep asking a lot of questions, i'm pretty new at game salad and the game i'm working on is fairly complex its coming along and i'm learning more and more. thanks!
Comments
Lastly if you need to optimize a bit if the scene gets heavy with actors/images/rules etc you could do a change attribute self.position X or Y for the switch moveable objects ... ie: so one is off scene, the other one, then they switch positions as needed rather than spawn and destroy (not so critical now as it used to be but the idea is there if you need it).