Jump to content

how to access Map Components?


norbert
 Share

Go to solution Solved by Josh,

Recommended Posts

 

How do I access the camera in C++ when loading the map start.ultra? The hang is created in the ThirdPersonControls component and attached to the players. Is there a command for this or is it just a roundabout way?

Kind regards, Norbert

 

 

Link to comment
Share on other sites

  • Solution

It's best to just keep all your code for that camera within the component itself, which is located in Source/Components/Player/.

However, when you load a map, the returned object has a list of top-level entities you can iterate through. You can check to see what components are attached to the entity, cast them to the appropriate class, and access all their members that way.

You can also use the Entity::SetTag and World::GetTaggedEntities methods to easily keep track of things.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...