I want to achieve a function for attack ,but how to select a target and get his information such as position and the object of the entity and so on??

Any comment will be welcome!

thanksHilake

You can use the pcmeshsel property class. If you use that then you will get messages in the behaviour that the mesh has been clicked on. Then you can ask the current position from the mesh (pcmesh->GetMesh ()->GetMovable ()->GetFullTransform().GetOrigin()).

I want to achieve a function for attack ,but how to select a target and get his information such as position and the object of the entity and so on??

Any comment will be welcome!

thanksHilake

You can use the pcmeshsel property class. If you use that then you will get messages in the behaviour that the mesh has been clicked on. Then you can ask the current position from the mesh (pcmesh->GetMesh ()->GetMovable ()->GetFullTransform().GetOrigin()).

There have two actor, when one actor want to attack the other. When the actor select the other one, then how to make the two actor know each other. Because when one actor selected by others, he just send message to hisself. How to make the others know his information.

There have two actor, when one actor want to attack the other. When the actor select the other one, then how to make the two actor know each other. Because when one actor selected by others, he just send message to hisself. How to make the others know his information.

Well that's up to your game logic to control. If you give all entities in your game unique names then you can easily find the entity and the behaviour. You can use normal C++ calls to talk between behaviours/entities in your game.

Well that's up to your game logic to control. If you give all entities in your game unique names then you can easily find the entity and the behaviour. You can use normal C++ calls to talk between behaviours/entities in your game.