RTS Game - Need help with an issue i am having :)

My brother and I are developing an RTS game. We have a script that we are using for the mouse to control units (point and click) and move them around.

The problem is the units form into one unit when the reach the clicked area and will not seperate. Im assuming it is some type of collision detection that i havent figured out.

The other problem is the units move through the terrain like hills and bumps that have been made. Rather than going around or over them.

Any advice on how to correct the issues?
If you need anymore information just let me know.
Thanks.

Chris

No help ? :frowning:

Could you give me some more information. Like how the choosing code look, and how does the collision body look? And do you have a rigidbody on them, and if you do have you locked anything on with XYZ?

Please also if possible give a short clip of the problems to make it clearer what the problem is and I will see if I can manage to help. :slight_smile:

Soundsnlike you are using transform.translate to move your units… this method basically ignores all collision since it basically teleports from point to point. Since your units avoid collisions they wont follow terrain and will all occupy the same location when they reach the target location.

Thats what I see as the issue anyway.

Might look into rigid bodies and use physics or move function… or character controllers (but severeal can get expensive I hear)…

Anytime a place a rigid body on my unit it falls through the floor. its just mountain terrain that it goes through. I have not locked anything on the XYZ, honestly im not sure what that is… Do You know of a tutorial video that could help me out with that?

The main issue that i am having is my cube (which is my place holder for a "unit/player) is able to go through any walls or mountain terrain sticking up from the ground. It does NOT fall through the ground in anyways. It’s just able to run through obstructions.

From that last reply it sounds like either your characters or your terrain does not have any collision. Otherwise the characters should not fall through the floor if you give them a rigidbody. Are you sure that everything have a collision box?

And I never had any problems with transform.translate and collisions. For me when I use that I cannot go through walls or anything like that. So not sure if that is the problem.