x

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"

how to handle script for a pick invertory system on multiple iterations of the same asset?

Dear all

I am working on a University research game project where the player find and pick up objects to work out math sums located on computer monitors, then place objects in front of the door to open it according to the asset, its colour and colour value requirements. but i am stuck in how to handle a pick up system but the trouble is many of the same object spawned in the world but any pick up system would only effect the one that was last spawned. I have got a collusion component around the asset with overlap event that have set Boolean to determine if in range.

How can I make it so the system to knows the different between each iteration and interact with that iteration if in range to fire some pick code. I tried also from trace by object, I run series if statement but no matter what I do it only toggle visibility of the last spawned asset and doesn't change its world location when i set new world location before toggle visibility back when i take object out of inventory. Please help me? I am attaching some of the script

alt textalt text

Product Version: UE 4.20
Tags:
more ▼

asked Sep 06 '18 at 10:31 PM in Blueprint Scripting

avatar image

Artboom91
1 3 5 6

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

1 answer: sort voted first

Is it just the case of not being able to specifically work out how to pick up an object, or is it more to do with inventory management? If it's just picking up the object I usually handle all interaction between classes like this with interfaces.

So I would create a base class that you want to be interacted with, in this case. picked up. and assign a custom blueprint interface to it that will execute your code when called. For instance if you create a blueprint interface and inside you create an event called "Pickup" you can then call that message from within any blueprint by doing, for example a trace in front of your character, and any actors that it hits, call the pickup message on them and the interface will fire if it is hit by the trace. If you then create a bunch of child blueprints off this base class they will all take advantage of this base code and you can add individual behaviour to each child if so desired.

alt text alt text alt text alt text

For more information on this method there's an old live stream on this stuff, it's long but has a lot of information in it that should still be relevant.

https://www.youtube.com/watch?v=EM_HYqQdToE

Hopefully this is what you were after, otherwise I've completely misunderstood the question and I apologise.

interface.png (87.6 kB)
call.png (212.1 kB)
add.png (88.7 kB)
execute.png (103.9 kB)
more ▼

answered Sep 06 '18 at 11:57 PM

avatar image

Ruffhaus Games
663 13 9 23

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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