I wanted to know if you could set a pc or npc to walk through anything (walls, doors, other placeables and so on) for a duration and then get it back to normal... Is this possible with a script somehow?
Walk through objects/placeables?
#1
Posté 07 août 2015 - 10:38
#2
Posté 07 août 2015 - 01:52
Once a walkmesh is baked, you can't allow any creature to walk through it if there's an obstruction baked in. This means you would have to specially set up any area where you want this to be possible so that none of the walls or placeables are baked into the walkmesh, either by making them environmental objects or by selecting "walkable" in their properties. To allow yourself to walk through walls, you could lay out a walkmesh helper across the entire floor, or you could set all of the tiles to open tiles with no walls, bake it that way, then change the tiles to have walls and don't re-bake it.
This way, anyone can walk through everything all the time. Then you would have to lay out objects with dynamic collision (collision boxes) in the shape and location of all walls and placeables, to prevent you from walking through them, and destroy them or recreate them whenever you want to turn on or off the ability to walk through objects.
The problem is that the pathfinding system has a very hard time figuring out how to move when there are dynamic collisions in the path. You will likely have to use the keyboard to move your character, and NPCs may not be able to move at all. Do some tests first in an open field with wall placeables with dynamic collisions active on them, which aren't baked into the walkmesh.
- kamal_ aime ceci
#3
Posté 07 août 2015 - 02:25
I see - thats how you could swim and fly...
A lot of work though sadly...
#4
Posté 07 août 2015 - 02:50
Yes, you cannot fly over the same spot as you can walk on, but that's a slightly different walkmesh matter.
#5
Posté 09 août 2015 - 10:46
The SetCollision() function set to TRUE allows the target creature to walk through other creatures, non-static placeables with collision turned on, and closed doors (all thing you usually wouldn't be able to walk through). With a bit of planning you could allow players to pass through selected barriers, but as Tchos said it won't allow you to defy the walkmesh.





Retour en haut






