Hey guys I have a question, I am working on a map that is made for capture the flag and need a start point. I am pretty noobish with scripting even though i have done tutorials and watched vids and experimented but outside of anything basic I am lost. I am a artist first.
I agree with jgodfrey, you need to give more details. But i think you will need to take a look at how triggers work because i think you will need to have a trigger point at your flags and if someone/other players enter that trigger zone, starts capturing or something like that.
And i think you might need some sort of AI codes if not this might be a multiplayer game. And if so, might need to work on some form of networking.
A more direct question would be how do I setup a flag to be picked up and placed at another base? Do I destroy the flag once the player enters the trigger? What method should I use to write a script for the bases. The flag is going to be dropped if the player gets killed and will remain there until the the team reclaims it or the other team recaptures it. Once the captured flag is taken to the opposing base they are awarded one point and the flag is returned.
well it isnt very hard so ill explain some of the key things.
The picking up of the flag:
Basicly you could make a new boolean variable in your player script and on enter of the colider set it to true.
When you go back to your base and that var is true you get a point or whatever and your boolean is set to false.
Also when you enter the colider of the flag you have to destroy it so you would do that on the flags code with destroy(this.transform.position).
When killed:
When you are killed just instantiate the flag ,respawn the player and then set its boolean value to false.
Now this doesnt answer all of the question you have but it should get you started