Ambiera ForumDiscussions, Help and Support. |
|
[ 1 2 3 ] Page 1 of 3 |
|
|||||
|
I wanna make a game in wich there would be some sentry guns on walls or ceilings. So how to do that? When we come closer to it they rotate toward us and start shooting us. And when we get far from it they will get to their previous position and stop shooting us. Is it possible without script? If no please give me the script. And as always: Thanks in advance... |
||||
|
No one answering the most awesome question... Why??? |
||||
|
you would want to make it so that the sentry would start attacking in a radious like when active camera in proximity, shoot, then add bullets, and also add aditional rotation so it looks at you before shooting no script needed also it would be cool if you could destroy the sentries, give them game actor and health |
||||
|
wrote: you would want to make it so that the sentry would start attacking in a radious like when active camera in proximity, shoot, then add bullets, and also add aditional rotation so it looks at you before shooting no script needed also it would be cool if you could destroy the sentries, give them game actor and health I am doing so... But you said that on proximity shoot bullets, it's awesome but how to start rotating sentry guns if he player is in a greater radius than shooting radius.... I hope you understood. |
||||
|
you want to add this code to it on proximity var Player = ccbGetSceneNodeFromName("MainCharacter"); and if you want it to shoot out of radius assign your player a tag in the game actor behavior then go to the game actor behavior on the sentry and set attack tags to player tags then copy on proximity shoot behaviors to the activation attack |
||||
|
btw the code is for rotation to player you can add it to tags attack to |
||||
|
On proximity execute javascript and then paste this code? That's it??? |
||||
|
If you want the guns to shoot at you... Simply use the game Ai and health behaviour aatched to the guns... And change the value of move speed to 0 so that they won't move at all.... Rest of all is done automatically.. When the player gets into its activation radius... Or you can use a proximity behavior... And then script the guns to rotate towards player on proximity and perform the shoot action.... By using... Ccbaicommand for shoot.. No need to get positon of player and move to player position... As sentry guns or mounted guns are fixed and cant be moved they can only be rotated....hence no need to use position of player... |
||||
|
thats what i meant btw they wont move to you if the movement is reset every few seconds |
||||
|
also can i plz have the object/ prefab your using as the sentry |
||||
|
I dont really have a prefab for sentry gun, i will download it. but how to rotate the sentry gun to player, please give me the code for it. |
||||
|
behroz-khan wrote: I dont really have a prefab for sentry gun, i will download it. but how to rotate the sentry gun to player, please give me the code for it. No one answering... why??? |
||||
|
wrote: behroz-khan wrote: I dont really have a prefab for sentry gun, i will download it. but how to rotate the sentry gun to player, please give me the code for it. No one answering... why??? No answer yet.. |
||||
|
Had already answered to your question, but if you want that other people will do the hard work for you like scripting or provide you with a cooked and backed source file for the thing you want.... You can hire some freelancer to do the job for you... We can only tell you the recipe... We can't serve you the cooked food... If you found this thing difficult you can pay some amount to other user or to me to develop this thing for you.. |
||||
|
I am not into programming (I hate it) so I don't want to program so I just want you to give me the simplest code to rotate the sentry gun towards player.... Please??? |
[ 1 2 3 ] Page 1 of 3 |
|