[SOLVED] How to make Actors impassable

sdieters

  • Posts: 2068
im not home atm, but tomorow i will have a look into that since we have to fix that by code.
sorry for that, but you wil have to wait.
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Guzzz

  • Posts: 556
Sure! No problem.
Thanks in advance!
Watch my new game http://www.hitandcrash.com based on my comic strip https://www.instagram.com/hitandcrash

HeadlessD is my dungeon-crawling game on iOs and Android. Made in Stencyl. https://www.headlessd.com/

infinitum3d

  • Posts: 89
Can you increase the weight of the enemies so that they are simply too heavy to push?

Guzzz

  • Posts: 556
I tried to use the Mass but it didn't work. I guess because Player doesn't push Enemies. Enemies just move accordingly X and Y of the Player.

Moreover, now they overlapping each other even when I make the mass 0.01. I can't turn things back. I can't make Mass 0 or turn this feature off. Before I used Mass they didn't overlapping, Damn! :(
Watch my new game http://www.hitandcrash.com based on my comic strip https://www.instagram.com/hitandcrash

HeadlessD is my dungeon-crawling game on iOs and Android. Made in Stencyl. https://www.headlessd.com/

sdieters

  • Posts: 2068
Mass has nothing to do with actors being able to collide with each other. Double check if the physics are all normal, and make sure that all actor collision boxes are not set to be triggers.

If that sets everything back to normal, you can try this:
Set the enemies and player to cannot be pushed (cannot be pushed should not disable physical collision, since i use that for moving platforms), and double check if their collisions are not set to be triggers. set your bullet to normal physics, but make sure its collision is a trigger.

Tell me how that works out. (still not home tho)
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Guzzz

  • Posts: 556
I solved the problem with overlapping and mass. I still want to know how to make object or Actors impassable. I want my enemies to surround Player and make him impossible to escape. I also want to make some rocks and walls that everyone in a scene cannot go through.
Watch my new game http://www.hitandcrash.com based on my comic strip https://www.instagram.com/hitandcrash

HeadlessD is my dungeon-crawling game on iOs and Android. Made in Stencyl. https://www.headlessd.com/

sdieters

  • Posts: 2068
i cant figure out why it isnt working.
according to the docs it should work with setting it to cannot be pushed:

Quote
What kind of Actor Type?
Determines whether the Actor can move or not.

Cannot Move: The actor cannot move or be moved, thus, becoming stationary.
Cannot Be Pushed: The actor can move but cannot be moved by another actor.
Normal: The Actor can move on its own and be moved by other Actors.

so perhaps we have to wait for a dev to take a look at this...
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Guzzz

  • Posts: 556
My guess is, since enemy moves accordingly to a position of Player, Enemy isn't pushed by Player. It's just looks like he has been pushed. I used the code which finds an angle and position of Player and sends Enemy to him. I actually don't know how to make Enemy stop or to make Player to take into a consideration the force of Enemy when he (Player) is going to move.

« Last Edit: June 09, 2014, 06:40:11 am by Guzzz »
Watch my new game http://www.hitandcrash.com based on my comic strip https://www.instagram.com/hitandcrash

HeadlessD is my dungeon-crawling game on iOs and Android. Made in Stencyl. https://www.headlessd.com/

sdieters

  • Posts: 2068
Yes and no. It could indeed be that your enemy doesn't get "pushed" because it is walking, but i tried a simple I with a stationary actor, and I still walk trough it...
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Guzzz

  • Posts: 556
Can I make a code which says to Player that he can go to his target (in my case it is X/Y position of clicked mouse) if X/Y position of Enemy doesn't include some X/Y position of his target? Or in other words Player may go if an Enemy doesn't stand in his way.

With not movable objects, like walls and stones I think could work the code that says when Player hits the object (wall for instance) he moves back for 1px and stops. So, whenever he tries to move into direction which lays through an objects he stops and to prevent him to hit the object all the time he moves back for not visible distance, about 1px. What do you think?
Watch my new game http://www.hitandcrash.com based on my comic strip https://www.instagram.com/hitandcrash

HeadlessD is my dungeon-crawling game on iOs and Android. Made in Stencyl. https://www.headlessd.com/

Guzzz

  • Posts: 556
I am still looking for a solution here.
I tried to make event when Player hits wall to make his velocity=0. It does stop Player's actor but it's really hard to move him away, since he hits this wall constantly and his velocity is trying to be=0. I guess it's because, in the first place, it moves a little bit farther than a border of collision and when Player wants to move away, his actor remain in the collision area where velocity=0. So when he moves even for 1px outside from this area he immediately gets velocity=0. It looks like Player got himself in a swamp, from which he is escaping by very small steps. 

Just as a reminder:
 I have Player's actor which moves when he gets X/Y position of clicked mouse. He gets an angle and velocity. The problem is, when he meets other actors, like walls, he moves through them. So if Player clicks behind a wall, his actor moves right through this wall. As additional this problem looks differently with Enemies. Enemies move accordingly X/Y position of Player's actor. When they see him, they move to him by angle and velocity. So, when they reach them they stop (if Player's actor doesn't move of course), but when he moves against them, they move accordingly new X/Y position of Player's actor as well. Which is logical but not right. Because Player has a chance to move all of them (or to push, which is not that kind of pushing, because there is no collision between them) just by moving his actor through them.
Watch my new game http://www.hitandcrash.com based on my comic strip https://www.instagram.com/hitandcrash

HeadlessD is my dungeon-crawling game on iOs and Android. Made in Stencyl. https://www.headlessd.com/

Guzzz

  • Posts: 556
It turned out that I just messed up with physics and groups adjustments.
Watch my new game http://www.hitandcrash.com based on my comic strip https://www.instagram.com/hitandcrash

HeadlessD is my dungeon-crawling game on iOs and Android. Made in Stencyl. https://www.headlessd.com/