Welcome to the Game Creator support forum! 

This a place to ask questions, discuss ideas and report bugs. Please, provide your Unity and Game Creator versions as well as clear reproduction steps when opening a topic and full console logs.

Refund Requests will be removed. See our refund policy and send us an email if you think you have a valid claim.

+2
Done

(How To) Create a Health Slider (No Answer Needed)

robsdroid215 3 weeks ago in Stats updated by Marti (Lead Developer) 3 weeks ago 1

I was up all night and noticed that my Health Slider would not work.

The documentation says to place the Stats Component on 'ANY' Game Object.

For me the slider will only work if the Stats component is on the 'Player' object.

------------------

Prerequisites

------------------

Game Creator 'Stats Module' needs to be enabled

Unity Version: 2019.4.1f1

Game Creator Version: 1.1.9

Below I wrote a document to help others. PLEASE NOTE: I am very new to Game Creator and Unity so keep that in mind.

------------------

Stat = Maximum Health a Player can Have

Attribute = Current Health a Player Has

------------------

------------------

Create a Stat

------------------

- Click the Game Creator Pull Down Menu > Preferences > Stats

- Click the 'Stats' Tab > 'Create Stat' button

- Create Stat like below image

------------------

Create an Attribute

------------------

- Click the Game Creator Pull Down Menu > Preferences > Stats

- Click the 'Attributes' Tab > 'Create Attribute' button

- Create Attribute like below image

------------------

Add 'Stats' Component to Player Object

------------------

- Click on Player in the Hierarchy, Then from Inspector Click 'Add Component' Button, Then add the 'Stats' component

------------------

Create and Prep 2 PNG image files for UI use

------------------

- Create x2 small .png image files in your favorite Photoshop like app

- Make x1 Image Red and x1 Image White

(Or download the below Images)

Red.png   
White.png

- Copy these images into your Unity Project

- Highlight the Image in your Project View

- Set the 'Texture Type' for both images to Sprite (2D and UI) then Apply

(To apply just click off the image in the Project Panel and a popup will appear)

------------------

Create your HUD UI

------------------

- Right click in your 'Hierarchy' and Select UI > Canvas

- Right Click your 'Canvas' and Select UI > Panel

- Right Click your 'Panel' and Select UI > Image

- Right Click your 'Panel' and Select UI > Image

- Right Click your 'Panel' and Select UI > Text

- Right Click your 'Panel' and Select UI > Text

------------------

Set your Canvas Layer

------------------

- From the Hierarchy Click Canvas

- From the Inspector > Layer = UI > Click the 'Yes Change the Children' button

------------------

Add 'Attributes UI' component to Panel

------------------

- From the Hierarchy Click your 'Panel' (under your Canvas)

- From the Inspector Click the 'Add Component' Button

- Add the Attribute UI Component

------------------

Configure your 'Attributes UI' Component

------------------

- From the Hierarchy Click your 'Panel' and Configure your 'Attribute UI' like the image below.

------------------

Add your PNG Files

------------------

- From the Hierarchy Click your 'Image - Background'

- From your 'Project' panel Drag your 'White Image' to your 'Source Image' in the inspector

- From the Hierarchy Click your 'Image - Foreground'

- From your 'Project' panel Drag your 'Red Image' to your 'Source Image' in the inspector

------------------

Configure your Fill

------------------

- From the Hierarchy Click your 'Image - Foreground'

- From the 'Inspector' > 'Image' configure like the image below

Note: I did not go over Anchors or HUD design in this doc...

Here is what mine looks like


Also if you don't like 100/100 and want it simply say 100

Change the Value format of the Attribute UI from {0}/{1} to {0}

-----------------------------------------------------------------------

BONUS... Not needed for Health Slider

A Damage Pad to test the above Slider

If you want to test your slider, you can create a simple cube with x2 triggers

Trigger 1 

Actions 1

Trigger 2

Actions 2

I hope this document can help someone.

+1
Answered

Modifying stats on player init

Mitch Treece 3 months ago in Stats updated by Marti (Lead Developer) 3 months ago 6

Hey Guys,

Just started diving into GameCreator (+ Stats), seems like a good foundation to build on so far! Was wondering what the best way would be to modify a player's stats on initialization.

I have "base" player object that gets fed data when spawned. This data dictates the player appearance, speed, and other attributes. I want to also add various buffs (or-debuffs) to this data and modify the player object's stat component when data gets fed in. For example, imagine the player data contains a hero class-archetype. I would want to modify base health, speed, etc based on that type.

Assuming I have a list of unique ID's (status effects / modifiers) on the data object, how can I load the effect assets and apply them to the player via code? Also, is there a better way to reference these in the editor besides using the unique IDs? Ideally, I'd be able to have a serialized array field on the data object that I can add the effect scriptable objects directly to.

Cheers,

Mitch

+1
Searching answer

Attribute UI not updating when using global variable

Sander 8 months ago in Stats updated by Phazorknight 3 weeks ago 9

I've made a simple UI with the stats of the enemy my mouse is hovering over. When using target game object and dragging the object in, the stats work. However, when using global variables, it doesn't. I have a global variable with the game object that was selected. 

0

Ragdoll issues with Synty character assets. Head spin like crazy

Sam Leitch 2 days ago in Stats updated 1 day ago 11

On death. They ragdoll, and i get a null reference for inverskinematics, track info, headspeed and untrack?

They just spin non stop. Example below. If anyone has any tips for me would be much appreciated.

NullReferenceException: Object reference not set to an instance of an object
GameCreator.Characters.CharacterHeadTrack+TrackInfo..ctor (GameCreator.Characters.Character character) (at Assets/Plugins/GameCreator/Characters/Mono/Characters/InverseKinematics/CharacterHeadTrack.cs:42)
GameCreator.Characters.CharacterHeadTrack.Awake () (at Assets/Plugins/GameCreator/Characters/Mono/Characters/InverseKinematics/CharacterHeadTrack.cs:125)
UnityEngine.GameObject:AddComponent()
GameCreator.Characters.CharacterAnimator:GetHeadTracker() (at Assets/Plugins/GameCreator/Characters/Mono/Characters/CharacterAnimator.cs:289)
GameCreator.Characters.CharacterAnimator:Update() (at Assets/Plugins/GameCreator/Characters/Mono/Characters/CharacterAnimator.cs:174)

0
Not Reproducible

[STATS] Bug

Michael Bay 1 week ago in Stats updated by Marti (Lead Developer) 5 hours ago 1

I've been getting this message

"Stat called  not present in TLB. Did you remove it?"

Obviously, I changed or deleted something... but tracking it down is a problem. 


Line 863 of the Stats.cs script is this: 

Debug.LogError("Stat called " + stat + " not present in TLB. Did you remove it?"


The value of stat is not being returned.

0
Planned

Stat underscores problem

Homie 2 weeks ago in Stats updated by Marti (Lead Developer) 6 days ago 1

Hi! I will be brief, underscores in the names [ID] of the stat module [formulas] do not work at all! 

This might not seem like a problem but, in variable names [global[name]], they don't work either!

Just let you know, you can easily reproduce it.


Log

Thanks!

0
Answered

I want fill bar health with stat ui variable

Francisco Jab 2 weeks ago in Stats updated by Marti (Lead Developer) 2 weeks ago 1

In attritube ui i have value format method and i can format output for fill square imaqge but in stat ui i have not this method (value format).


0
Answered

Attributes text fields - what is their purpose?

markusrgb 4 weeks ago in Stats updated by Marti (Lead Developer) 3 weeks ago 5

Hello, everyone,

someone can explain to me what these text and icon fields are for. No matter where and what I insert there, I don't see any place where they will be displayed to me. Do these fields have any meaning at all?

Answer

This is to dynamically update UI elements that you have created on your canvas.




Here is how I have that in use on a small test scene:
The attribute is called "stamina", so my UI text updates to "Stamina" (on top of the green bar).
The value scale x is the green bar game object.
The value text is the 100/100 text game object.

All of these update at runtime when my stamina gets changed by actions and so on.

If you download the stats examples, you can see these set up for a health bar and mana bar as well.

0
Planned

Stats do not work with special characters.

rexdefuror 4 weeks ago in Stats updated by Marti (Lead Developer) 3 weeks ago 1

Summary: 

When trying to name variables with special characters (ie. underscore _ ) Stats component reports an error.

Error is recognizable by the absence of stat name.


Steps to reproduce: 

  • Create a stat with _ in the name, ie. skill_proficiency
  • Assign stats to a character
  • Create OnStart trigger with action to debug that stat
0
Under review

The "Attributes UI" does not work when I use it via a global variable.

markusrgb 1 month ago in Stats updated by Marti (Lead Developer) 2 weeks ago 4


Hello, everyone,

the "Attributes UI" does not work when I use it via a global variable.

I use the Global Variable to temporarily refer to enemies or trees etc.

When I look at a tree object to which the global variable currently points, the attribute is displayed correctly.

However, it does not synchronize with the life display in the canvas.

if I do the same with the player as the target, it works without problems

the upper life display is that of the player, the lower life display is that of the game object to which the global variable refers.

thanks a lot

Markus