Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
AshwinTheGammer

Implementing AirStrike in multiplayer FPS[Photon]

Question

I wanna create airstrike feature like Call of Duty has. I wanna do following :
When player score 300+point then I wanna enabl
e airstrike like in gif
Please login or register to see this link.

then after 5 sec i wanna disable the fighter jet's camera and destroy jet. How could I do this?
I've planned following 
Instantiating the jet from a point then allowing player to control the jet and shoot at ground players.
Then de-activating the jet's camera and activating Fps's main camera after 5 sec.
The only problem is I don't know how to implement this and what should  I program ?
THAT'S ALL! I HOPE YOU GUYS UNDERSTAND
Please login or register to see this link.

Edited by AshwinTheGammer
i forgot something.

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 1

It seems to me that you are trying to create a predator attack.

Instantiate jet, change camera parent - player to plane (so change your character controller). Click a point on the ground (a vector3 by raycasthit). Then change again your camera parent (plane to player like at start). Destroy plane. Instantiate after a while an explosion based on the vector3...

I could do that this way ++

  • Confused 1

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

Ooo! but how to change character controller from player to jet? and what do u mean by changing  camera parent? Just elaborate more...

Share this post


Link to post
Share on other sites
  • 0

Disable the first and enable the second - and vice-versa.

You have to code two character controller ++

Share this post


Link to post
Share on other sites
  • 0

Cool. Next - AC-130 :)

Share this post


Link to post
Share on other sites
  • 0

:( :( I did various things but none of them worked:
First I wanna instantiate the jet when player presses J and then disable the camera of player and setactive the camera of jet.
then i wanna make plane down to ground on the angle 45 then i wanna fire and then after 5 sec i wanna disable the camera of jet and setactive the fps camera. but i couldnt do that.
Check out the script and tell me what i was doin wrong?


 

Please login or register to see this code.

here is jet's script 

 

Please login or register to see this code.


i was calling like this :

 

Please login or register to see this code.




 

 

Share this post


Link to post
Share on other sites
  • 0

Never! Never you said that you was trying to implement air-strike under Photon :)

Share this post


Link to post
Share on other sites
  • 0

* write logic in separate project/new scene (without networking)
* don't use PhotonNetwork.Instantiate(). You can simply send RPC to start event and instantiate your rocket.

 

Edit: wait "airstrike" was when you set target points, when you control falling rocket, or when you are shooting from heli/jet?

Share this post


Link to post
Share on other sites
  • 0

OK! OK! Actually I can't instantiate the jet and i cant disable the fps camera and enable jet's camera. That's the only  problem. I'd posted scripts regarding that. This is the only last feature i've to add in game.

I've to shoot from jet in sky like this:
Please login or register to see this link.

Edited by AshwinTheGammer

Share this post


Link to post
Share on other sites
  • 0

You don't have to disable camera. Simply disable controls on player when you instantiate jet. For jet camera set "Depth" higher then players camera and it should be enough.
Where is problem with instantiation? When you instantiate (and you don't have errors), then object will be instantiated. Question is only how you move/sync jet position/rotation. Most likely jet shows up in wrong position (you can see it in Hierarchy window).

By the way, how do you plan to move jet? You can control jet, with animation, or you use waypoints?

Share this post


Link to post
Share on other sites
  • 0

I had made a script for shooting from jet but that didn't work. :( And can't instantiate, YES I CANT INSTANTIATE EVEN THOUGH I CALLED A INSTANTIATION PROCESS. I just have to make jet down in the direction of terrain and then shoot and then come back to player. I got your point that I've to disable the controls of players when I instantiate the jet. That's the problem!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×