Forum rules - please read before posting.

Trouble Accessing Objects from Player Prefab via ActionList

Hello,

I am having a bit of a problem with accessing objects that are a child of my player prefab.

AC Version: 1.8.17
First Person
Context Sensitive

Context: I am attempting to shoot a gun when InteractionA (left mouse button) is pressed. This is set up with the Input editor and the input is enabled. This is a simple press left click to shoot your gun action, and I have done this before on a few other projects previously but I am stuck currently in this new project even though I am sure everything is set up the same way.

What's going wrong:
I confirmed the ActionList is being ran, but references to objects that are a child of the player prefab seem to be getting 'lost'. For example, I simply want to play the shooting animation on the player's first person arms and to play a muzzle VFX. I have done this many times before with no problem, but unless I am overlooking something simple I'm at a loss why this isn't working now.

When comparing this project to my previous ones, the only difference I can find is the AC version, and I just want to check to make sure it isn't perhaps a bug before I continue hitting my head up against the wall?

Here are screenshots, each one is accompanied by comments which explain further: https://imgur.com/a/vBk9svu

Summary:
Upon further testing, when I was trying to isolate the problem, it seems that any Action that references an object that is a child of the player prefab is not happening. While anything on the outer systems like: Dialogue playing, global variables changing, etc are happening just fine.

I feel like I have set things up exactly as I have done in previous projects and have spent all day re-checking my steps as I try to avoid making these posts when I can. But after some testing and cross reference, I am wanting to see if maybe the version I am using has a problem with referencing children of the player?

Any help would be much appreciated, and I can provide further info if necessary. Thank you

Comments

  • Thanks for the details.

    It does look like an issue with referencing objects by ID number, but I can't reproduce it.

    Backup the project, and test the latest release - does it work there?

    Also: is there a difference if you place your Player prefab in the scene file, avoiding the need to spawn it at runtime?

  • Thanks for your response, Chris.

    Yes, having the player already in the scene rather than spawning in does fix this. Everything works as intended when an instance of the player is already in the scene.

    I would still like to look into this a bit more and figure out how to access children objects from the player prefab - there's no reason that I must do this at the moment, but perhaps in the future.

    In regards to the latest release, I am getting some errors after updating regarding 2D animations and an Error importing the main camera prefab - I'll spend some more time on this and will update/provide more info with pics in the near future if I can't figure it out.

    Thank you for the help!

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.