- Home /
Programming dynamic barriers
I have a shooter game where the player is fighting against 3 enemies. When the player kills all three of them, player has to move to an other area. Here is the pic:
So we begin at 1. The colored boxes are the walls or barriers. When the enemies are still acitve you cant trespass through the barrier. Only when they are killed. And when they are killed, the player has to go to 2. After the traspassing the blue barrier should then not be trespassable and the green one also. Then the 3 enemies can spawn in area 2. And so on. Do you guys know how I can implement that kind of dynamic barrier?
Answer by Pangamini · May 28, 2019 at 08:43 AM
OK I will assume here that you are using the navmesh for navigation Well, you can create a NavMeshObstacle with carving enabled. This creates a temporary hole in the NavMesh, while the object is active. The other option is to create a NavMeshLink, which is a kind of 'jump' between two locations on the navmesh. The are won't be smoothli navigable, as a normal navmesh would, but the advantage is that it can be set to one-directional passage, so easier for you to prevent the player from going back and forth
no I'm actually using ml-agent to move the enemies. And the player is moved by me.
Well if it's moved by you, then the motion is constrained by you (where it can or cannot walk). So you want to write your own collision system to implement the barriers?
I just want to move the walls when I have killed the enemies and when I moved to area 2. When I am in area 2 the blue wall should be closed, and the enemies are spawning.
In details: First round: I am in area 1 with the enemies. Blue and black walls are closed. When I kill the enemies, blue wall should be opened. When I move to area 2, enemies should spawn and blue wall should be closed. And this should be in a loop with 1,2,3,4
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
Dynamic wall movement 0 Answers
Create a Dynamic Wall 2 Answers
Problem with dynamic wall 1 Answer
Problem with dynamic wall 0 Answers