edited September 10 in General Discussion
hi, i want to achieve the "Final Fantasy" airship function, after doing so, there is a problem:
1. Can not use the conditions of control of the beginning of the player was born, when the airship set as a player,
when switching scenes will automatically be born in the birth of a default player.

2. If you use another airplane, add an automatic event to destroy the player, but when the airship landing, the player can not be born.
Post edited by SK1 on
  • If the player is changed into an airship (i.e. the airship isn't placed somewhere in the scene to enter), you can use Conditional Prefabs on the combatant to change the normal prefab for the airship prefab (and back) by e.g. just setting a global variable that's used as condition.

    If you're using an airship to enter/exit, it's best to have exchanging the player for the airship on other maps through either an autostart event or a global event (using the Scene type).

    For landing, you can use a Spawn Player node to spawn the player at the position of the airship before destroying it.
  • @gamingislove,Thank you have solved the problem of spacecraft, but now there have been new problems.

    When you switch to a spacecraft, the spacecraft rises to a certain height, because gravity re-dropped to the ground, when I use a custom controller, add a controller to the player and the spacecraft, one with gravity, one without gravity, When controlling the player, the spacecraft does move with the player at the same time, when the arrow keys, the spacecraft and the player will move at the same time. Two objects can not be individually controlled separately.
  • There is also a problem: when I control the spacecraft in the map to move to a new location, when the switch to the player into a new scene, and then return to the spacecraft scene, the spacecraft will appear in the starting position, rather than docked Location, can not save the spacecraft after the scene location.
  • For your second question, every time after you finished docking the spacecraft, add a transform to variable node to your docking event. This will save the position of the spacecraft into a vector3 variable. Let's call this variable "docking". Add an new auto start event to your spacecraft. Create a new event. In this event, add a change position node. Inside this node, move the spacecraft to the variable " docking ".
    Save, and add it to the auto event. Now the position of your spacecraft should be save every time you change scene and come back.
  • If player and spacecraft are there at the same time and both have control components, you'll need to disable or remove the component on one of them to prevent both from being controlled at the same time.
  • @Shadow_Fire , @gamingislove,thank you all。
    I have solved the first issue of the spacecraft, but on the second question, or can not save the location of the spacecraft, can you give a detailed variable to help.
    My settings are as follows: But Transform To Variable does not work, spacecraft always moves to scene position 0,0,0
  • edited September 23
    There are three problems with your setup. :)
    First, don't use space when naming your game variables.
    Second, in your transform to variable node, in the value type, don't put in Game Variable, but put in Value.
    Third, don't put transform to variable and change position next to each other because this will save the position of the spacecraft and in the next instant the position of the space craft will be change instantly to the variable, which is exactly the same spot.
    You have to put transform to position into your event that is responsible for landing your spacecraft.
    Post edited by Shadow_Fire on
  • hi,@Shadow_Fire,Where do I set global variables? I do not know where to set non-empty global variables.
  • You set the global variable spaceshipPosition to the change position node, just like in your picture.
  • I now set up an interactive switch that, when interacting with the switch, sets the global variable as the position of the spacecraft to test whether the global variable is working. When I interact with the switch, the spacecraft will still go to the world (0,0,0) position.
    I would like to know how the vector to the global variable works There are no examples of global variables in the tutorial.
  • edited September 23
    To help you better, I just did a quick test, and it works perfectly over here :)
    You did everything right, just that in the transform to variable node and variable to transform node, don't put in game variable as the value type. Put in Value.

    And global variables just mean that if you define a global variable, you can use that variable just wherever you want. If you are still confuse, spill it all out, so we can clarify more :)
    Post edited by Shadow_Fire on
  • @Shadow_Fire ,Thank you。
    I finally get success, and test the use of a global variable, the original need to first Game-> Game Setting-> Initial Game Variables, set a game variable.
  • hi,@gamingislove。
    On the new issue of spacecraft: When I take the spacecraft, the spacecraft will rise along the Y axis 2 height, when I landed the spacecraft, the spacecraft will drop along the Y axis 2 height.
    I use the Change Position's Local Position. When there is a rise, the Local Position is set to Y2, and the Local Position is set to Y-2 when it is landed. Whenever I switch to the new scene and return to the spacecraft scene, the spacecraft's Y-axis will automatically increase by 1 height, and will not return to the height of the ground near the ground, how can I avoid such a problem?
  • edited September 26
    It's probably best to find the ground below the spacecraft using a Raycast To Variable node (storing the position on the ground into a variable). You can use the stored position (Vector3 variable) in the Change Position node to move the spacecraft there.
    Post edited by gamingislove on
Sign In or Register to comment.