Forum rules - please read before posting.

Moving the player character in Object: Transform action

edited March 2014 in Technical Q&A
I'm trying to create instance where the player is knocked around, climbs while facing one direction, etc. and moving the player via the Character: Move to Point or Character: Move Along Path always requires the player to walk, and makes the player change the direction he faces when the movement changes direction.

Also, creating a custom path for each time the player is to be moved can get very tedious and messy.

I attempted to give the player prefab the movable script, and use the Object: Transform action to move the player as desired, which overall gives it the effect I'm looking for. However, when using the prefab as the movable object, the action does not work. It seems to be required to be a gameobject which is currently in the scene in order to be moved by this action.

When actually putting the player prefab into the scene and giving it the movable script, this action does work because the player prefab has become the actual player in the game mode. However, when changing scenes this relationship doesn't hold. The player character is added to each scene, and therefore is not referred to by the Object: Transform action, because the stationary player prefab is. 

Has anyone found a way to have the player usable as the movable object in the Object: Transform action? I've tried modifying the script but I know way too little about scripting in Unity to be particularly effective there. Any ideas?

Comments

  • If you make an asset-based Action (i.e. one in an Inventory or Menu ActionList), you reference objects by their ConstantID number.  However, the ID is reset for prefabs, so you won't be able to reference the prefab itself.  This is probably an oversight on my part - I will look into removing this restriction for you.
  • Great, thank you! I tried messing with the script myself but that got fairly messy.
  • edited April 2014
    With the new 1.29 update I've noticed I can give my player prefab a constant ID, but I can't seem to figure out how reference that ID within a scene based action list, or reference an asset based action list from a scene based action list.

    I have tried creating an inventory and menu action list for transforming the player but I have no way to reference those lists, beyond setting up a custom inventory item for the interaction I want to occur (which happens when the player steps on a certain area, so no inventory item should be necessary).

    Is there a reason why the object: transform action cannot have a "is player?" checkbox like many other actions? It seems to me that it would be quite a useful tool that would allow a developer to forgo making many simple animations (such as turning, scaling). 

    Or am I doing something wrong again (which is quite possible!) Either way, thanks again! 

    Edit: Wow, just found the Engine: Run action list action! That solves my problem! (I guess I'm still curious though if the object: transform can have an "is player" checkbox though)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.