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"

Best way to change\swap object in game?

Good day guys, I am new with BP and I have something in mind and would like some advice before starting it. I would like to be able to change a mesh in game with a widget. For example, 3 static meshes (Sphere, Cube and a Plane) and each time I am selecting next on the widget the actor will change as a loop, Sphere, Cube, Plane, Sphere etc... Is it something like turning visibility ON on the Sphere and OFF on Cube and Plane, etc.... or there is an other method to do so? Thanks in advance guys.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 08 '18 at 03:55 AM in Blueprint Scripting

avatar image

Screechfx
1 1 1

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

1 answer: sort voted first

Yes you can do it that way if you like. Less work for the garbage collector that way.

You can also spawn and destroy. Just mind the collision and sizes either way, if they are meant to collide with things.

To cycle around an array of references to components or actors you can increase the index variable you make for it each time, adding 1 to it, mod by the length of the array and then assign that New value to the index var.

more ▼

answered Oct 08 '18 at 07:21 AM

avatar image

mightyenigma
3.8k 18 20 20

avatar image Screechfx Oct 08 '18 at 07:59 PM

Thanks a lot MightyEnigma, Like I said, I am pretty new in BP. I did understand the logic of it but don't know where to start. I will try to figure that out. Do you know a tuto that can help me a bit? I will try to find some. Cheers, Matthieu

avatar image mightyenigma Oct 09 '18 at 05:50 PM

Well I am not able to prepare a tutorial at this time, but if you post a screenshot or two of your current attempt and point out where it's not working, I can tell you what to change to fix it.

Do you know how to put Actor or component references into an Array? That's the key to making my idea of how to do it work.

(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