New user: two questions

Hello to everyone,
I am studying Unity just to understand if its the right tool the make the game I would really like to play (its a turn based wargame played with miniatures). I cant fail with the Unity choice because I cannot buy a MacBook just to make a try.

I had approached darkBasicProfessional but I didnt find it a productive development environment.

So all I need now is just to understand HOW to make things in Unity. Thats a little series of questions that will clarify a lot of doubts I have now:


Figure 1)
As you can se from the first screenshot, the game is played with ‘units’, that are made by one or more miniature bases. The same 3d model repeated depending on the size of the unit.
All bases of the same unit always move together, but they move in formation (in this example the move in LINE formation).
One of the moves I have to manage is the wheeling (to the right or to the left). A wheel to the left, as shown on the picture, requires all units to rotate around the leftmost miniature base.
How can I accomplish it in Unity (what kind of rotation should I apply)?
Do you think that the gameobject that represent a “unit” will be a single 3D model (miniature base) with attached, as children, the other miniature bases?


Figure 2)
How can I display a CONE of fire, as shown on the image, that is displayed in a semi-transparent way over the terrain (what kind of tecnique should I apply, considering the terrain has different heights)? It is a triangular shape that starts exactly from the center of the formation

Thank you very much
Simone

If you make items 1, 2, 3, children of item 4, and you rotate item 4 to the left about the y axis, the others would wheel to the left as you describe. Similarly, making items 2, 3, 4 children of item 1 and rotating item 1 to the right would make them wheel to the right.

I’d use a projector, like that used with a blob shadow but probably a different shader–I think there’s one on the wiki that would suit.

–Eric

Thanks for the answer, but how do I rotate it to the right? can I change childrens on the fly?

Yes. transform.Rotate is one way to do rotation, or you can set eulerAngles, or use other functions.

–Eric

I think I can set the rightmost unit as the parent and all others units on the left as its children. This will make the rotation work perfectly if I rotate to the right (wheeling around the parent unit).

But how do I manage the rotation to the left? Can I change at runtime the gameobject and set another unit as master and all others as children?
(I mean, to wheel to the left I need the leftmost unit to work as the pivot of the rotation, so I need to set it as the master unit)

Yes, you can easily do that with code.

However, I think it would be even easier to forget about making some units children of others and instead just rotate all the units around a point corresponding to either the leftmost or rightmost unit. See:

Rune

Hi Rune, I like your suggestion, but I would like to manage all the units together, because in the game they stand as a single unit, they always go around together, fight together, etc

Anyway, you are telling me that I can manipulate the gameobject at runtime as I desire? making a child becom the master and so on?
Can I even change the relative position of a children relative to its master? (the last sentence sounds strange lol)

Simone

Yes.

Yes:

All the things you have talked about so far are rather trivial to do in Unity (and probably also in most other game engines I must admit). You are not making very high demands. :wink:

Ahahaha yes I’m not willing to make Far Cry 3… my little game is simple and since I still havent got a MacBook I’m starting to study the simple things

Anyway you forgot one thing!!! How can I visualize the cone of fire diaplayed in the second screenshot?

This was already answered by Eric…

Yes but I hoped it was not the only solution applicable to that problem

BTW yours is a nice website

It’s very simple to use so I’m not sure why you’d want another, more complex solution. :slight_smile:

–Eric

Thanks Eric, please forgive me, its just because i’m doing the project on paper right now… i’ve experience with other development environments (c++/Directx and DarkBasicPro) but at an early glance I found your suggestion a bit obscure since I still havent got unity and I cant test it