# I want to judge whether the creative\_device obtained with GetCreativeObjectsWithTag is the corresponding device.

**URL:** <https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814>\
**Category:** Verse\
**Tags:** unreal-engine, unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [October 8, 2023, 3:35am UTC](https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814 "2023-10-08T03:35:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HAMU\_VERSE\_JP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hamu_verse_jp/32/724287_2.png) [@HAMU\_VERSE\_JP](https://forums.unrealengine.com/u/HAMU_VERSE_JP)\
**Post date:** [October 8, 2023, 3:35am UTC](https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814/1 "2023-10-08T03:35:45Z")

</div>

I would like to change the score points given to players depending on the weapon they have when they win. (with conditional\_button\_device(GetItemCount))

However, I cannot use if to compare the conditional\_button\_device extracted from tag and the corresponding conditional\_button\_device. (It will be a red wavy line.)

Isn’t it possible to use “if” to determine if creative\_device is what it is?

```auto
condition_tag := class(tag){}
---
---
    @editable
    conditional_10_1 : conditional_button_device = conditional_button_device{}
    #There are many others...
---
---
    WinnerJudge(Agent:agent):void=
        Print("I am Winner")
        Conditons := GetCreativeObjectsWithTag(condition_tag{})
        for (Obj : Conditons):
            if (Condition_Button := conditional_button_device[Obj]):
                Counts_ := Condition_Button.GetItemCount(Agent, 0)
                if (Condition_Button:conditional_button_device = conditional_10_1:conditional_button_device): # <----# Red wavy line... 
                    Points : int = 10
                    ScoreAward(Agent, Points)

```

---

<div class="post-metadata">

**Author:** ![PiEqualsThree3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PiEqualsThree3](https://forums.unrealengine.com/u/PiEqualsThree3)\
**Post date:** [October 8, 2023, 3:57am UTC](https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814/2 "2023-10-08T03:57:59Z")

</div>

This line already checks if the Obj is a conditional button. Because you are casting that obj into a conditional button, the if statement will only complete if that obj is a conditional button.

```auto
 if (Condition_Button := conditional_button_device[Obj]): 

```

So there is no need to do this

```auto
if (Condition_Button:conditional_button_deviceconditional_10_1:conditional_button_device):

```

which doesn’t exist btw

---

<div class="post-metadata">

**Author:** ![HAMU\_VERSE\_JP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hamu_verse_jp/32/724287_2.png) [@HAMU\_VERSE\_JP](https://forums.unrealengine.com/u/HAMU_VERSE_JP)\
**Post date:** [October 8, 2023, 6:12am UTC](https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814/3 "2023-10-08T06:12:28Z")

</div>

Thanks for your reply.

I know the below line checks weather the Obj is “conditional\_button\_device” or not.

```auto
if (Condition_Button := conditional_button_device[Obj]): 

```

I want to check weather the Obj is the “conditional\_10\_1:conditional\_button\_device” or not.

It has many other “conditional\_button\_device”.

```auto
    @editable
    conditional_10_1 : conditional_button_device = conditional_button_device{}
    @editable
    conditional_20_1 : conditional_button_device = conditional_button_device{}
    @editable
    conditional_30_1 : conditional_button_device = conditional_button_device{}

```

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 8, 2023, 10:45am UTC](https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814/4 "2023-10-08T10:45:19Z")

</div>

I don’t think conditional\_button\_device are comparable objects. You could try comparing their position instead ? 🤷

```auto
if (Condition_Button.GetTransform().Translation = conditional_10_1.GetTransform().Translation):

```

But be aware that forgetting to plug conditional\_10\_1 will result in [a server crash](https://forums.unrealengine.com/t/critical-gettransform-error-shuts-down-a-lot-of-verse-devices/1240404)

---

<div class="post-metadata">

**Author:** ![HAMU\_VERSE\_JP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hamu_verse_jp/32/724287_2.png) [@HAMU\_VERSE\_JP](https://forums.unrealengine.com/u/HAMU_VERSE_JP)\
**Post date:** [October 8, 2023, 2:42pm UTC](https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814/5 "2023-10-08T14:42:29Z")

</div>

It means comparing based on the location of the device.  
I’ll try!

---

<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:** [November 7, 2023, 2:42pm UTC](https://forums.unrealengine.com/t/i-want-to-judge-whether-the-creative-device-obtained-with-getcreativeobjectswithtag-is-the-corresponding-device/1325814/6 "2023-11-07T14:42:50Z")

</div>

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