# Why Does Identical Blueprint Code Behave Differently in Two Identical Unreal Engine Projects?

**URL:** <https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question, Blueprint, troubleshooting\
**Created:** [June 24, 2024, 8:16am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512 "2024-06-24T08:16:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaZPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BaZPT](https://forums.unrealengine.com/u/BaZPT)\
**Post date:** [June 24, 2024, 8:16am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/1 "2024-06-24T08:16:10Z")

</div>

Imagine creating two identical Unreal Engine projects and writing the same simple blueprint code in both. Sometimes the code works in one project but not in the other. I have reinstalled Unreal Engine, and I am using almost all default settings. I’d like to understand why this happens?

---

<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:** [June 24, 2024, 8:46am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/2 "2024-06-24T08:46:54Z")

</div>

Are here possible timing issues here? Are you relying on things happening in a certain order on begin play? That could be it…

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [June 24, 2024, 8:52am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/3 "2024-06-24T08:52:13Z")

</div>

Hey there @BaZPT! Welcome back to the community! As Clockwork mentioned, depending on how the blueprint is implemented, it’s possible that it’s affected by other differences, such as time, updates to the template in the time between, defaults that have changed, etc. With some context to the blueprint itself, we may be able to provide a bit more personalized insight.

---

<div class="post-metadata">

**Author:** ![BaZPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BaZPT](https://forums.unrealengine.com/u/BaZPT)\
**Post date:** [June 25, 2024, 1:03am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/4 "2024-06-25T01:03:00Z")

</div>

I have only a single function in a newly created project. The function can be called anywhere (begin play, tick, ‘input’…), no matter where. I don’t get any errors or warnings. Here is a basic example of what happens.

 ![0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/3/d237fcbcd0dee7116dbb0be4199f7528faab9b8e.png)

A=1  
B=1  
X= A+B (always = 0)  
It doesn’t make sense.  
Thank you for the answers, but I don’t think that’s the problem.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [June 25, 2024, 4:05am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/5 "2024-06-25T04:05:00Z")

</div>

i think you’ll find that A and B are set to 0, default.

where are you setting them and are they local variables?

---

<div class="post-metadata">

**Author:** ![BaZPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BaZPT](https://forums.unrealengine.com/u/BaZPT)\
**Post date:** [June 25, 2024, 9:18am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/6 "2024-06-25T09:18:04Z")

</div>

I appreciate your reply.  
I think I might not have explained myself properly with my example.  
What I meant with my example is that, I have two projects that are exactly the same, with the exact same blueprint, no alterations made, however while I run one of them with the example above of A=1 and B=1, meaning A+B=2 and it runs smoothly without issues, the other project doesn’t run the variable as desired.  
I know how to set variables, and whenever there’s errors, I normally know how to solve it by rewriting the code, however when this starts happening it’s demotivating to remake the whole project all over again to find out that there were no mistakes, it was just the variable not running accordingly. Of course when we’re speaking of small projects, it’s easier to remake the project, but when we’re speaking of bigger projects it’s very demotivating to remake the whole project and blueprints and variables with it.  
Has anyone else experienced this issue, and if so, how have you solved it?

---

<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:** [June 25, 2024, 9:21am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/7 "2024-06-25T09:21:30Z")

</div>

If A and B are 1, then X will be 2, period 🙂

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [June 25, 2024, 11:26am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/8 "2024-06-25T11:26:30Z")

</div>

just put a breakpoint there, it’ll let you see exactly all the variables exactly when they are called

---

<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:** [June 25, 2024, 11:35am UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/9 "2024-06-25T11:35:00Z")

</div>

Don’t rely on the debugger, use a print string.

---

<div class="post-metadata">

**Author:** ![HawaiianGamer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hawaiiangamer/32/950473_2.png) [@HawaiianGamer](https://forums.unrealengine.com/u/HawaiianGamer)\
**Post date:** [June 25, 2024, 12:39pm UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/10 "2024-06-25T12:39:39Z")

</div>

Do you mean that at some point the project appears to be corrupted and can no longer be fixed that you need to resort to recreating it?

---

<div class="post-metadata">

**Author:** ![laggyluk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@laggyluk](https://forums.unrealengine.com/u/laggyluk)\
**Post date:** [June 25, 2024, 2:50pm UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/11 "2024-06-25T14:50:48Z")

</div>

I know this sounds like black magic but from time to time, newly added blueprint variable can be broken in a way that it’s always unset, ignoring what was set as default value. can be ‘fixed’ by deleting and adding again. I had this couple of times in different engine versions and I have no clue what’s the cause or how to repro

---

<div class="post-metadata">

**Author:** ![BaZPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BaZPT](https://forums.unrealengine.com/u/BaZPT)\
**Post date:** [June 25, 2024, 3:45pm UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/12 "2024-06-25T15:45:09Z")

</div>

Thank you so much for your reply.  
It’s good to know that I’m not the only one with this issue, however a bit sad that there isn’t a known solution for it, as it can get quite annoying.  
If you end up figuring out a way to make this stop, let me know, I’d really appreciate it.  
I’d like to thank everyone who tried to help.

---

<div class="post-metadata">

**Author:** ![laggyluk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@laggyluk](https://forums.unrealengine.com/u/laggyluk)\
**Post date:** [June 25, 2024, 3:54pm UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/13 "2024-06-25T15:54:01Z")

</div>

I literally did, you need to delete the faulty variable and add it again

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 25, 2024, 3:54pm UTC](https://forums.unrealengine.com/t/why-does-identical-blueprint-code-behave-differently-in-two-identical-unreal-engine-projects/1914512/14 "2024-07-25T15:54:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
