how to make a homing rocket

Options
sss
sss

how to make a homing rocket. I can not specify the target - the player, if I know the network name of the player - the target

Answers

  • Tobias
    Options

    You will likely have to figure out the ViewID of the networked object you want the rocket to follow.

    You know who is shooting, so in theory, you can simply call an RPC on that target to tell everyone "the rocket is shooting towards this" and as everyone knows who shoots, you don't have to sync everything else in-between.

  • sss
    sss
    edited April 2023
    Options

    I made a list of players. I choose the target by the nickname of the players. spawn a rocket. Then it will fly using NavMesh. But I don't know how to find an object - a target by its nickname or ViewID and assign it to a variable of the GameObject type.

  • Tobias
    Options

    Nicknames can change. Use some reference / ID that doesn't change during a match.

    You can find a PhotonView via it's ViewID by PhotonView.Find(viewId). The parent of it, is likely the GO you look for.