Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Calling a specific Object (Actor) of a Class?

So I have two Weapons on the ground. They have the same class, but they have different meshes and names.

So, I haven't made any complex inventory system yet. But what I planned to do was that, when pressing a specific button, my Character would equip the LAST weapon that was picked up. I already set up the equipping part, but how do I set up that "check"? Whenever I use the Cast to Weapon block, I have no idea what to do with the "object" pin. How can I call a specific object (in this case, the last picked up weapon) from a class?

PS: Whenever I pick up a Weapn, its name and mesh are saved inside a structure. And I was planning to use that to communicate with the player Character blueprint. Because then I'd use this structure to set up the inventory system, so that you could have all weapons that you've picked up and choose the one to equip from there.

alt text

So, this is the portion of the Blueprint that allows my char to pick up weapons and prints a string telling me the name of the Weapon I've just picked up. As you can see, I'm referencing to a struct. This works.

Product Version: UE 4.16
weapon.png (232.7 kB)
more ▼

asked Mar 14 '18 at 05:15 PM in Blueprint Scripting

avatar image

6 2 2

avatar image Velrin Mar 14 '18 at 06:05 PM

Are these structs kept in an array? If so, can you just reference the last struct in the array?

avatar image SpaceJoker Mar 14 '18 at 06:44 PM

As of now, they aren't. But I might try this one later.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question