# Trying to follow an old tutorial but what changed? (I think it's something to do with arrays)

**URL:** <https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363>\
**Category:** Blueprint\
**Tags:** unreal-engine, Array, UE4, UE4-27, Blueprint, question\
**Created:** [March 5, 2022, 10:20pm UTC](https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363 "2022-03-05T22:20:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![visau](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@visau](https://forums.unrealengine.com/u/visau)\
**Post date:** [March 5, 2022, 10:20pm UTC](https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363/1 "2022-03-05T22:20:26Z")

</div>

Hello I’m doing a Masters Degree in Renewable Energies and I found a video on simulating solar panels in UE4. The video was very detailed and I followed it exactly but when I compile it doesn’t work. There are some comments on the video talking about that the engine changed in the meantime so the code isn’t exact anymore. I’ve been trying to find the problem and I think I found it.

The video that I followed is this one: [UE4 Energy Generation Series - Tutorial 5 Part 1/2 - Solar Panel - YouTube](https://www.youtube.com/watch?v=ty6kQatXuw4&list=FLO81kdtFCkCtf9YYH6MMTsg&index=3)

The only thing that changed noticeably from the tutorial from 2018 it’s this

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/0/5b076de81d2d3f35294c6b2df58d808373af6a54.png)

In the video when he gets component by class the return value it’s already in array mode, but in my BP it has to be converted in array.

I think that this is the problem because when I do the condition later it returns false.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/d/ced5e8e397f200b1061d9ca9ba86c7ca116bce18.png)

The solar panel is an actor that has 6 cells (static mesh component) called "Cell1, Cell2, Cell3… and a Base)

PD: For some reason if I compile normally it doesn’t work at all, but when I compile the solar panel and press play it work only for one cell and it doesn’t produce power. But that’s unrelated I think.

I don’t have any Idea of UE4 (I only created maps for UT99 when I was like 10 haha), I just tried because I wanted to start using UE4 and it’s seemed like a fun thing to do to get used to it.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Yaklakootmaa2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yaklakootmaa2/32/1194607_2.png) [@Yaklakootmaa2](https://forums.unrealengine.com/u/Yaklakootmaa2)\
**Post date:** [March 5, 2022, 10:32pm UTC](https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363/2 "2022-03-05T22:32:15Z")

</div>

Haven’t heard about changes in basic stuff.  
First of all, use for loop to print out names of each element in the array before, to understand does it contain all that you need or not.

---

<div class="post-metadata">

**Author:** ![sportbil](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sportbil](https://forums.unrealengine.com/u/sportbil)\
**Post date:** [March 5, 2022, 11:24pm UTC](https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363/3 "2022-03-05T23:24:21Z")

</div>

The “Get Component by Class” node in your screenshot will only give the first found component, there should be a “Get Component **S** by Class” node that will give you the array output with all components.

Both nodes pops up when you start searching for “get componen…” so you likely just clicked on the wrong one a bit too quick

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 6, 2022, 8:52am UTC](https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363/4 "2022-03-06T08:52:55Z")

</div>

If it’s already an array, just drag off and find the for each loop.

It’s always better to make the nodes by dragging, rather than trying to connect them together. This is because the engine already has implied types in the placed nodes.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 6, 2022, 9:48am UTC](https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363/5 "2022-03-06T09:48:16Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/9/b09aa7462e91b3ce495a3c74b4c5db0e911d745d.png)

My bet is that you simply plopped down the incorrect node. edit: as per @sportbil comment - read it too late.

---

<div class="post-metadata">

**Author:** ![visau](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@visau](https://forums.unrealengine.com/u/visau)\
**Post date:** [March 6, 2022, 12:00pm UTC](https://forums.unrealengine.com/t/trying-to-follow-an-old-tutorial-but-what-changed-i-think-its-something-to-do-with-arrays/504363/6 "2022-03-06T12:00:29Z")

</div>

■■■■ yeah that was it haha tanks!
