#blueprint

1 messages · Page 29 of 1

radiant hinge
#

^

lunar sleet
#

Your widget should represent the int calculated outside of it not the other way around

modern radish
#

if I get a variable value from my game instance, increment it inside my BP Player controller, do I need to set it again or is Increment enough to propagate it back?

manic vessel
#

Basically I want to set a max number of players in a session from the UMG

lunar sleet
#

That’s not where that should be handled

#

UMG should visually represent the underlying logic not be the root of it

#

Unless you’re talking a text box where players can put a number that you can run logic against, then you don’t have a choice ig

manic vessel
#

MAKES SENSE , but this is for a host screen and I want to host to pick there values like like how many bots to spawn .

dawn gazelle
manic vessel
#

thats what I mentiond , I will have arrows in ether direction instead that Edits the int value then the text block will just display it

#

everyones happy

modern radish
lunar sleet
manic vessel
#

I know This Is not a UMG . But wanted to show My solution To the previous Issue. I thinks Its nice and simple

silent quiver
#

Is it possible to only call the animation BP update when actor sees pawn?

I've got a simple "on see pawn > walk towards pawn" BP, and I realised it's constantly updating it's animation, though it only needs to animate, when it's actually seeing the player (pawn). So can I trigger the update on the animation BP from the actor BP, when the actor BP sees the player?

scarlet hedge
#

How can I make the START SCALE and END scale a variable ?

#

or change the transform of the set static mesh

faint pasture
#

are you using a blend space or just playing an anim?

solemn basin
#

I would like to create a card deck list button that shows the cards in order from top to bottom. This deck is created from list that is only numbers. What structure should I use in unreal to create this list? If I was coding it outside of Unreal, I'd probably use a text document to read and write the deck list. Is there something similar in Unreal?
I was thinking I should use a Data Table, but i'm not sure if I can read and write directly from a Data Table.
Right now i'm using a Data Table to hold all the Data about the cards: CardID, Name, and Image.

silent quiver
#

'm using a BlendSpace

lunar sleet
faint pasture
#

The data table defines which cards are in the game.
An array of card structs can define a deck or hand

faint pasture
#

Why do you want to turn off animations when not moving. Just let the blendspace do the work and give it an idle anim or pose.

silent quiver
solemn basin
faint pasture
#

I'm guessing it's not a problem right now if ever

faint pasture
#

if someone doesn't know what a struct is they are nowhere near using C++ right now lol

lunar sleet
#

bp structs at broken when it comes to editing them at runtime

silent quiver
#

True 😅 I guess I got a little carried away, since I was already optimising a BP I got from a tutorial

faint pasture
#

Just don't get too wild with it and just pass them around as data and things should work mostly

lunar sleet
#

Well he wants to do live edits at runtime on them as far as I could tell

#

So that should be fun 😀

silent quiver
solemn basin
faint pasture
#

The DataTable contains the definition of all cards

#

the deck contains instances of cards or just rows of the datatable

solemn basin
solemn basin
faint pasture
#

If it's a collection of decks

#

Then it'd be an array of Deck structs which contain arrays of Card structs or row ID's (which can be used to lookup the card)

solemn basin
#

A list of cards that the deck uses.

faint pasture
#

Yeah that'd just be an array of either card structs or row ID's

#

Struct Deck
Deck Name
TArray<CardStruct> Cards
Other data
Other data

mild pine
#

Hey guys, how can I spawn an actor along a line from the AI's actor location? I want to spawn multiple missiles dotted along a line.

faint pasture
mild pine
# faint pasture Do you know how to spawn an actor at a location?

Yeah, I'd prefer not having a lot of scene components though. Might've just coded too much today to think straight about this issue hahaha. Was thinking maybe there was a way to calculate increments between -250 (for example) and 250, and spawn an actor on every 50 increment 🤔

faint pasture
#

I was just asking if you knew how to do the spawning part

mild pine
#

Oh, yeah

#

I just need help with the math 😅

#

If you don't mind 🙏

faint pasture
#

Just calculate the difference between the start and end points, then loop and add Index x Difference / Count to the start position

mild pine
#

Oh, so using a line trace?

faint pasture
#

what

trim matrix
faint pasture
#

what does a line trace have to do with this?

#

it's just math

#

do you have the start and end position?

mild pine
#

Oh no, I just need to have a start and end point

#

I'll pop down two scene components and go at it from there 🙂

faint pasture
#

you have a target right?

#

you don't need scene components

mild pine
#

Yeah, I have a target 👍

faint pasture
#

End = Target.Location
Start = Self.Location
DifferenceVector = End - Start
DifferencePerStep = DifferenceVector / (NumPoints + 2)
for loop between 1 and NumPoints
SpawnLocation = Start + Index x DifferencePerStep

mild pine
#

Thanks!

sand slate
#

Hello! Im trying to make a game with local multiplayer, and I read online that you should controll the character from the player controller and put all the actions and inputs there for a local multiplayer. I put everything in the pawn, is it true that I need to putt everything in the player controller?

zealous moth
#

Depends on inputs

crude spruce
#

i think i solved it

#

oh no i didnt

#

epic be like: y u wanna exclude on a local basis anyway? just press the make game buttons!

trim matrix
#

woah u seem to be doing some crazy stuff there

crude spruce
#

i need a reliable updated character mesh without specific limbs.

trim matrix
#

like a mesh splicing thing?

crude spruce
#

So far its reliable unles sits gonna be ragdolled.

#

No its 16 mesh parts

#

modular character

trim matrix
#

crazy

crude spruce
#

the effect i need is to skip traces against bones where the limb is missing.

#

i have learned that mesh merge is pretty hot

#

Can input an array of skeletal meshes

#

when using leader pose components i had to add components and all that

#

this just makes a mesh and i can set one component to the result

#

heck... with mesh merge my lookup routine for any local limb details is just a bless

#

and morph targets is disabled. Since i dont have any yet, its fine. Im assuming that when i get some, this is a feature or its cheap to work around 😄

silver sentinel
#

hey guys - is is possible to somehow set focus between 2 actors or am I barking up the wrong tree?

silver sentinel
#

hmm looking at this it might be something custom in the poiunt and clkick adventure toolkit

trim matrix
#

wdym set focus?

silver sentinel
#

its coming from a marketplace asset, I thought it was generic blueprint my bad

trim matrix
#

but what are u trying to do?

#

U mean "set focus" as in making the cam look at some point?

silver sentinel
#

there are some cam setups included, you can choose to 'focus' on an actor, i was just trying in the level blueprint to set the focus on a worldspace point between 2 actors

#

I can shift the focus based on events but il have to mod the cam blueprints i guess to allow extra stuff

prisma delta
#

Alright... I need to figure out where the best place to store player death and respawn code is.
I had it in game mode and was told that wasn't correct, put it in the parent character blueprint, now when my player is destroyed my controller says the player is invalid and stops communicating with the character blueprint.

#

And apparently booleans can't be saved or loaded.

faint pasture
#

or character, depending on what Dying means

runic parrot
#

Hi!

Does anyone know if there's a way to batch-modify the value of some property in a BP DataAsset based on some other data asset?

For example:

"DataAsset_A" = "NumberProperty = 3"
"DataAsset_B" = "NumberProperty = 25"

Read B and modify value of A to 25

prisma delta
#

My boolean parameters to detect of mouse and keyboard or of gamepad is active doesn't save. It resets to default values when the save game load happens

faint pasture
prisma delta
#

sure sec

#

save game code

#

it does save and load the transform

#

loading

#

just not the bools

mild ibex
#

Bump 😔

faint pasture
#

how do they get set to begin with?

prisma delta
#

They're set by an event dispatcher from the options widget

#

After They're set it runs the event to the save game function

#

@faint pasture

faint pasture
prisma delta
#

I did and they return the proper values when the dispatcher fires, but whenever the character is destroyed, it resets the booleans to default value

#

Basically it completely ignored the load even though my print says it's been saved and loaded

#

I know the save/load functions are working because it is properly saving and loading the transform of the spawn point when changed

fiery moon
#

Since it loads just fine, but is then reset, isn't it just loading too early? before some default or being done or whatever?

faint pasture
#

I bet it loads and then later gets overwritten by whatever sets them to begin with

prisma delta
#

Mouse active is set to false then saved when the character respawns it sets the value true

#

There's only one place it can be set, which is the dispatcher

#

I read on the forums that booleans can not be saved or loaded because they're (for lack of a better term) temporary?

frosty heron
prisma delta
#

I guess I need to find a better way to enable/disable mouse and keyboard or gamepad

frosty heron
#

You can certainly save and load boolean

prisma delta
#

Booleans not being saved to my save game bp

frosty heron
#

Skill issue then?

prisma delta
#

The transform however is

frosty heron
#

I save and load my bool all the time

prisma delta
#

You can check my code ^

#

Tell me if I fkd up

#

But I know it's saving and loading the changes to the transform so I doubt it

frosty heron
#

It's pixelated but it doesn't look great

#

When you cast , just get the variable and plug it to the cast

#

I can't read the rest from my phone

#

But anyway you can save a bool

#

I do it all the time

runic parrot
faint pasture
#

@prisma deltaHave you printed the bools on save and load and confirmed that they are not the same?

prisma delta
#

The save game and load game function is in my character blueprint event graph so there was no need to cast to them.

#

As the booleans exist in that blueprint

dawn gazelle
#

Delete your .sav file and try again. You absolutely can save bools and your code looks correct there.

prisma delta
#

Okay I will give that a shot

#

Funny how I test everything last night and it's working perfectly, open the project today and a dispacher errors out >.< (unrelated to the booleans)

frosty heron
#

You should only load the savegameobject once as well

#

it seems to me you are loading them everytime you save the stats (The load will return different savegameobject)

prisma delta
#

It loads the saved settings on respawn

frosty heron
#

yes but not necessarily using the same savegameobject, so becareful

prisma delta
#

Not sure of a better more efficient way, I guess I just don't know what I don't know

frosty heron
#

it's not about being efficient but getting the same savegameobject that you want.
Imo you should only load the SaveGameObject Once and use that as the reference for the rest of your game (Eg when you want to save)

#

when you want to save, you shoulnd't have the need to LoadGameFrom slot

#

you should just, GetGameInstance->GetMySaveGameObject->SaveToSlot

prisma delta
#

That makes sense

frosty heron
#

I ran to this problem the other day and I relaised that the output from each LoadGameFromSlot is not the same

#

hence things are not saving properly

prisma delta
#

I've been saving references to the blueprints and variables, but neglected to do the same with those functions

frosty heron
#

all the best

prisma delta
#

Thanks, I'll need it

zealous moth
#

Can you save game data using data assets?

#

So far I have been using structs inside of the save game file

#

But these tend to be unstable

crystal crown
#

very basic question but how can i set previous axis value. brain not worky

frosty heron
crystal crown
#

i want to do this in bp
if (FMath::IsNearlyZero(PrevThrottle) && !FMath::IsNearlyZero(Throttle))

mental trellis
#

And what is prevthrottle? Be specific.

crystal crown
#

const float PrevThrottle = DrivingState.Throttle;
Throttle = bThrottleDisabled ? 0.f : Throttle;
VMC->SetThrottleInput(Throttle);
DrivingState.Throttle = Throttle;

mental trellis
#

Right. So you have prev throttle. What's the issue?

zealous moth
lunar mulch
#

I just found out i can't use Timelines on Components or inside of functions. Im trying to "Fade in" a variable, usually i'd use a timeline for that. Anyone know a backup solution that could gradually fill up a variable?

mental trellis
#

Create an actor with a time line component and attach it to your component and use it to fade your variable? 🙂

#

Or put a time line in the host actor.

dawn gazelle
#

Or use tick with a gate that you shut off when the target value is nearly equal to the actual value

lunar mulch
#

hmm all good ideas thank you

pulsar crest
#

so I'm trying to access the variables of my struct in a blueprint, but they do not show up on the context finder
They show up on the default values

I have them defined as UPROPERTIES I'm not sure what im missing

USTRUCT(BlueprintType)
struct FIntMatchStat
{
    GENERATED_BODY()

    UPROPERTY(BlueprintReadWrite)
    int32 CumulativeTotal;
    UPROPERTY(BlueprintReadWrite)
    TMap<float, int32> ValuesByTime;
    UPROPERTY(BlueprintReadWrite)
    int32 TeamId;
    UPROPERTY(BlueprintReadWrite)
    FString StatName;
    UPROPERTY(BlueprintReadWrite)
    EMatchStatType StatType;
mild ibex
# mild ibex Bump 😔

following up with this

I read that actor components dont have transform values at all, which makes sense as to why the vector widget doesnt appear, because it technically cant exist.

So, is there a way to add something with transform values as a "co-parent" on any actor. For instance adding a scene component works but will only ever be a child of the actor causing pretty much the opposite of what i want to happen.

pulsar crest
runic parrot
#

Has anyone have luck editing a DataAsset default values using a Editor Widget?

frosty heron
#

Things like rebuildwidgeteditor() and postchangeedit() etc can only be called in cpp afaik

runic parrot
#

Oh i didn't tough about making a new Editor Widget class from a cpp base so i can have more tools there

#

thanks for the info, i'm going to check that

frosty heron
runic parrot
#

i'm okey with c++, didn't come to my mind to do a custom class there for Editor bp widget

#

sometimes the answer pass by so easily (?)

frosty heron
#

Its a widget after all

#

But to get the uasset I run cpp script from my blueprint function library

#

Then I iterate through all my material and change its static switch setting

runic parrot
#

you can also get the UAssets with this on the asset manager

#
  1. make a constant on your asset manager class for the "type" of items you want to register
frosty heron
#

👍

runic parrot
#
  1. On your primary data asset, override the method "GetPrimaryAssetId"
frosty heron
#

Nice

runic parrot
#
  1. Register it on the editor by name, director or specific location (can't compile the project now, crap)
#

so you can do "Get me all the assets of this PrimaryAsset Class"

#

it's great for expansions or updates

frosty heron
#

Don't you want to grab two specific dataasset.uasset

#

And set its member variable

#

You can use class list in editor utility widget to select the DA

runic parrot
#

yeah, kind of.

  1. I want all the "Loot Chest" Primary data asset
  2. Loop all the assets in the array property "ItemsDrops"
    and adjust members of "Loot Chest" asset based on the properties of "ItemsDrops"
frosty heron
#

Gl

ivory garnet
#

Does anyone know a good way to handle a ready check to pass turn once everyone's ready in a multiplayer game? I'm struggling...

frosty heron
ivory garnet
runic parrot
#

Or you can do it as a replicated property on PlayerState and keep track there

#

you can use rep notify to inform the changes to players

#

If you are not familiar with MP, the player state one is probably the best

#

This is pretty much what you want, but instead of score, bools.
https://www.youtube.com/watch?v=AmFGRmfAEHs

In this series we will be explaining how to add online multiplayer to your games. First we are going to explain how it works, then we will go into creating lobbies etc.

In Part 8 we explain how to use the Player State actor to store each player's score they earn whilst playing in a multiplayer game.

SUPPORT ME
Patreon I https://www.patreon.com...

▶ Play video
frosty heron
#

Read the compendium in the mp channel if you haven't

#

Bp only fps is not even playable imo

#

I hope Ur mp game is not fps

ivory garnet
#

It's a Turn based strategy game

frosty heron
#

At most you can do a board game or turn based game

#

Strategy like controlling units?

runic parrot
ivory garnet
#

Each player has one unit, you can choose an ability like league of legends, and where to move for the turn

frosty heron
#

K at least it's not like age of empire like strategy game

#

Should be doable

ivory garnet
#

Maybe closer to divinity original sin, but each player has 5 skills and the map is a smaller arena

runic parrot
#

yeah, sounds doable

#

I would play with MP first to get the basics of it

ivory garnet
#

That's reassuring haha, the multiplayer part is definitely giving me a run for my money

frosty heron
#

Can always do single player for easier mode

runic parrot
#

you get a lot of free space since you don't need milisecond precision or pixel track

runic parrot
#

@frosty heron by any chance did you got a BlueprintEditorUtility made with a cpp parent class child of UEditorUtilityWidgetBlueprint ?

#

can't reparent my utility bp or make a new one with this custom class as base

frosty heron
#

I didn't make a base class for the editor utility widget.

Made it normally, however the functions for the widget like grabbing assets in the content folder is a UFunction from my cpp bfl

#

@runic parrot

runic parrot
#

what about the part of editing the data assets default value? was that on BP or it used c++ functions?

#

I can already grab them on BP, but can't find how to edit the defaul values

frosty heron
#

Cpp function, it cannot be done in bp. I never tried to change data asset, what I change was material interface

runic parrot
#

ohhh my bad in that case, i'm going to confirm if it's possible to edit DA default values in that case

frosty heron
#

Pretty sure it's possible with cpp

#

I know u can change data table too

#

Which is only possible in cpp as well

runic parrot
#

yeah, it has to. The DataAsset widget is doing it with some cpp functionality, so it's there somewhere

frosty heron
#

I would ask in #cpp , they have better ideas. Can't check rn cuz my nephew is using my pc

#

My only experience is not with a blueprint assets but with material

novel rock
#

How dose the third Person character example allow the camera to rotate around the player?

novel rock
tidal marlin
# novel rock

GetPlayerController()->SetControlRotation(GetControlRotation().Combine(0,0,1)) on tick

novel rock
#

Figured it out

graceful zodiac
#

Is it possible to set 'Expose on Spawn' variables when you use a class variable to spawn an actor? Or only if you 'hardcode' the value.

frosty heron
graceful zodiac
#

Ah - nifty! Unfortunately, I need to keep it generic, but good to know that's an option. Thank you!

#

I'm just setting the variable after I create it now, should still work, will just need to make sure it's valid before I do anything is all

#

In theory I could cast the generic class to the specific class 🤔 I'll do that if I need to

violet chasm
#

Could I run a line trace on the GPU? I have a simplex noise node driving the noise of a mesh through WPO and hence I can't replicate the noise in blueprint to drive a buoyancy function. I setup a render target under the boat to read from the scene depth but it's too slow. So I was wondering if I could a run a line trace from under the boat but on the GPU so that it would intersect with the mesh? There many of those going on to render a scene so one more wouldn't hurt right?

frosty heron
#

@runic parrot Yo, u there?

runic parrot
#

yeah, what happened?

frosty heron
#

This set the properties

runic parrot
#

but that is at runtime, right?

frosty heron
#

editor time

runic parrot
#

btw: I already got it working with the suggestion of someone from cpp, it was really easy and it's stupidly efficient for what i wanted : D

#

oh that's nice

frosty heron
#

That's great

runic parrot
#

This to get all the assets of "LootChest" type

#

and the method is on cpp

frosty heron
#

good stuff

runic parrot
#

your info helped a lot also, thanks a lot!

frosty heron
#

doubt it but good to see you sort it out

topaz turret
#

Is there a way to set or reset velocity? I'm trying to make a double jump that can be used any time while InAir and grants the same height boost even if triggered after apex, so I figured I'd do that just before that 2nd jump to prevent a fast fall from completely negating the force of it, but I'm not finding it or anything similar 🤔
edit: Found a solution! For anyone else interested, there is a node called "Stop Movement Immediately" which is essentially this exact function. 👍

scarlet pumice
#

Performance wise, is there anything to watch out for with this pattern for infinite looping?
Any tips on making it look better? 🙂

frosty heron
#

just use timer

scarlet pumice
#

what if I want to randomise the delay?

frosty heron
#

you can do that with timer

scarlet pumice
#

different delay each time?

frosty heron
#

New timer each time the last one finished with a new time (can be randomised)

scarlet pumice
#

like this kinda thing?

frosty heron
#

not quiet

#

@scarlet pumice

#

actually same thing

scarlet pumice
#

cool, thanks, Create Event looks neater 👌

#

and the Start custom event, good tips, thanks

frosty heron
#

You can store the handle incase you want it to stop

scarlet pumice
#

it's working perfect 👍

#

Do you know if there's any difference re: performance between using a delay loop or a timer?

frosty heron
scarlet pumice
#

Yeah that makes sense

#

It always felt wrong routing back

frosty heron
#

If you care about performance, you would be looking at soft references, moving latent operation like for loop or heavy nodes to c++

scarlet pumice
#

Yeah I'm very familiar with the C++ side, it's the BP that's new to me. I am just wondering how the Delay node is implemented. Under the hood it probably uses a latent action and a timer anyway

frosty heron
#

don't worry about delay/timer/ticks

#

I've no idea with the C++ side, but we kinda have to use timer because there is no delay node there.
There is Laura's coroutine if you need something like delay in cpp

scarlet pumice
#

I want to establish good habits in the BP side of things too

frosty heron
#

you can always profile to see the performance cost. I personally never do it cuz I'm lazy

scarlet pumice
#

our game thread is insignificant compared to draw thread 🙈

frosty heron
#

Yeah, depend on the scope of the project

#

i heard components is pretty expensive

#

and ofc blueprint tick is heavy

scarlet pumice
#

yep we try and avoid tick in general

frosty heron
#

don't think you should avoid it

#

there are things that belong there

#

like movement for example

#

or animation related

red berry
#

Why does blueprint objects have no constructor? I want a lightweight class that I can call some things straight away but I don't want to have to use Actor or ActorComponent

thin panther
#

Nothing in BP has a constructor

#

You get a construction script, but this is not a constructor

red berry
#

Should I make the weapons and guns as an Actor or object? If all the logic (e.g. the fire rate, chambering, etc.) is handled by animations, since I need a state machine, then does that mean the AI can exploit a gun and make it rapid fire when its not meant to?

tidal marlin
red berry
# tidal marlin Better actor. Or better yet, Uobject. In general, it all depends on whether you ...

Well I want when the weapon is dropped, either intentionally or if its thrown away or dropped from death, the existing state should be saved. So if there's one in the chamber but the npc was killed halfway during the reload animation, the weapon will drop on the ground without the mag, and the mag will be dropped too on the floor nearby. This should be saved in the inventory too, and a nice to have is multiplayer too (but not needed yet)

tidal marlin
red berry
#

Why is it that you cant network replicate objects and structs in blueprints? What about if you have an Actor that has a Struct as a variable, does that Struct never get updated or replicated?

frosty heron
#

Who says u can't replicate structs or objects 0o?

#

I don't have much experience in mp but im pretty sure u can

#

some types that can't be replicated by default are Maps, Texture, material, audio, etc

#

You can replicatre objects but you have to use Actor channel afaik

#

gotta piggy back off an actor for it to be replicated

bold phoenix
#

Hi ! I have a problem when making the sun rotate in my game at runtime. If I move the Yaw from 0 to 360 with a slider and the "set actor rotation" node it works fine, but when I move the Pitch slider from 0 to 360 it also modifies the Yaw value of my actor

#

Any idea about where this might be coming from ?

gentle urchin
#

And structs

bold phoenix
# frosty heron Show your bp

I don't have access to my computer rn, but it's really just a "set actor rotation" node linked to a slider with min value 0, max value 360

frosty heron
#

but again w/o seeing anything, it's hard to suggest

true oriole
#

how to change gamemode in blueprint ?

#

i want to open a level with different gamemode

#

because i want to change the character

#

ok i think i figured it out

bold phoenix
#

I'll come back with some pictures

hearty river
#

hi guys how can i make that when i press the button "play" it change color from red to (for example) yellow?

frosty heron
hearty river
#

Thank you

patent scaffold
#

Hi, I want to implement a simple door interaction system where when the player clicks on the door (I'm using EnhancedInput), their look and move ability is disabled (through SetIgnoreMoveInput & SetIgnoreLookInput) and the movement of the mouse only on the X-Axis moves the door. I'm stuck on the last part as when I disable look, (obviously) the movement for mouse on the X-Axis is also disabled and the door doesn't budge. What other way could I go about solving this issue?

This is the event graph on my door (I realise the input action here doesn't work the same as it did in the previous input system)

red berry
#

How do you prevent a circular reference if a player has an equipped weapon, but we need to know if the weapon is equipped to someone or not?
If I use a variable in the weapon, its not a 1-to-1 relationship, because the player might lose the reference to the weapon, or stash it away, but the weapon might still be "isEquipped" either to true, or to the previous player. Is there a way to get a reference to the player but without loading the player BP?
This is needed because in OOP its bad to have circular references, and children shouldn't have references to parents

clear sierra
frosty heron
#

what's wrong with Object A knowing Object B and Object B know about Object A

#

also in BP any hard reference will load the object to memory

#

downside of it

clear sierra
#

You cant compile code in C++ if you do it like this, In blueprint you can do circular references, but usually you add interaces to remove circular references.

red berry
#

That doesn't answer or fix that the weapon can still think its equipped to the player, but the player has already stored or dropped the item. I want to prevent this from happening in the first place.
In javascript you could pass a callback function from the parent and you would call that to check if the player has the item still equipped. I don't think you can do anything like that in Unreal. There's no callback functions. Event handlers you can call don't return values

frosty heron
#

you can pass values with delegate

#

or event dispatcher

red berry
#

I know you can. But I need to return or get a value. Instead of having Item: IsEquippedToPlayer, which is a variable. We can instead call a method in the player, IsEquippedWithItem. I need a return value from the event dispatcher

frosty heron
#

I don't know what Weapon is in your case but generally you want to broadcast events when the Player pickup an item, drop an item, give an item, etc etc.
The broadcast will pass along the needed data (eg the weapon) and handle call accordingly

#

Bind WeaponDropped
OnWeaponDropped -> GetDroppedWeapon -> SetOwner to None -> Set CurrentEquippedWeapon to None -> Inventoryweight =- , etc, etc

red berry
#

EventDispatchers don't have output variables

versed sun
#

Pass along a ref to Self, and call a seperate function to return

frosty heron
#

I don't know what kind of model do you have in mind but what's stopping you from creating weapon system that is not ridden with bugs with what's offered on the table?

red berry
#

I dont know why its so hard in blueprints to do something so simple:

  1. The "easy" hacky way (not maintainable, will be buggy eventually)
    Player
  • Var:EquippedItems (array)

Item

  • Var:EquippedToPlayer (Actor)
    or
  • Var:IsEquippedToPlayer (boolean)
  1. What I want, more maintainable and robust, less buggy
    Player
  • Var:EquippedItems

Item

  • Func:IsEquippedToPlayer (boolean)
    -- Get some callback or event dispatcher, where we call the parent, and check Parent>EquippedItems
frosty heron
#

https://stackoverflow.com/questions/1897537/why-are-circular-references-considered-harmful
'Circular dependencies between classes are not necessarily harmful. Indeed, in some cases they are desirable. For example, if your application dealt with pets and their owners, you would expect the Pet class to have a method to get the pet's owner, and the Owner class to have a method that returns the list of pets. Sure, this can make memory management more difficult (in a non-GC'ed language). But if the circularity is inherent in the problem, then trying to get rid of it is probably going to lead to more problems.

#

1st page in google if you need validation

#

What's stopping you from calling the owner of the weapon and get its currently equipped weapon?

#

is this the concern "Is there a way to get a reference to the player but without loading the player BP?" ?

red berry
#

Loading the playerBP is of secondary concern, but the first concern is that if the player drops the item, the item should no longer have a reference to the player.
It would be simpler if there was a way to do it, like how 1-to-1 relations are done in SQL and databases

frosty heron
#

Weapon have variable Owner

#

OnWeaponDropped -> Set Owner to null

#

also if you need to get the Owner Equipped weapon, many ways

#

Just get a direct ref, or use component or interface

red berry
#

I know I can just set the owner to null, but if you forget to do it, then you get bugs. Its not a true 1-to-1 relation. A true 1-to-1 relation means if either the player or item delete the relation, then the other loses the reference. It should be built in. Is this not possible with OOP?
Edit: I guess I'll just use the simple IsEquipped variable in the item, as items shouldn't have any reference to the parent at all. I'm doing lots of reading on the web

frosty heron
#

define deleting the relation?

red berry
#

Just an automatic way of doing 2 things in 1 thing, without having to do 2 things seperately, which if you forget to do 1, it won't work
Edit: I can't seem to find any solutions to this. I give up over engineering this and I'll just use simple variables and just code as normally

elfin hazel
#

Mind if I ask, why would you forget to null a reference? Do you have a bunch of weapon classes that implement the same logic? That's where you can use inheritance to implement base functionality in a class, that is inherited to the weapons.

crystal crown
#
{
    if (const UChaosWheeledVehicleMovementComponent* MovementComponent = Cast<UChaosWheeledVehicleMovementComponent>(GetVehicleMovementComponent()))
    {        
        if (WheelIndex < MovementComponent->GetNumWheels())
        {
            return FMath::RadiansToDegrees(MovementComponent->GetWheelState(WheelIndex).SlipAngle);
        }
    }

    return 0.0f;
}```
How to make this in blueprint?
frosty heron
#

Try some 🦵 work, post what you think it does

#

You can make a function called GetWheelSlipAngleInDegrees that return a float , and takes an int as the input

frosty heron
#

imagine not giving error, you will go over thousands of lines and not knowing what actually went wrong

#

in cpp land , accessing null obj is instant crash

crystal crown
#

Not sure how to get wheel index

frosty heron
# crystal crown Not sure how to get wheel index

is this a function? go to the detail panel, look for input and output.
For input you want type int and name it WheelIndex
For output you want a float type and call it WheelSlipAngleInDegrees

crystal crown
#

The naming does not make the calculation. How do i set it up? Please help, kindly

#

Just like this?

frosty heron
#

you have to finish the rest your self, I don't have chaos vehicle

elfin hazel
#

The WheelIndex is the index of the wheel in the array. Like so. I also don't have chaos vehicles.

frosty heron
#

GetVehicleMovementComponent then cast it to ChaosVehicleMovement component

#

Also for the branch , Get the chaos wheel component -> Get Number of wheels and plug it to the bottom one below WHeel index

elfin hazel
#

I've found it very useful for functions that returns a value, to start with this:

#

So that it will always return something, can of course be returned earlier to break execution.

crystal crown
#

sorry if i'm dumb

elfin hazel
#

If you have your function selected, the details panel should show input and output. In the input, add a variable and make it an integer, name it WheelIndex. Output do the same but it's a float named Degrees.

crystal crown
#

Like this?

#

🫣

onyx violet
#

im using this color wheel plugin, I have it converting the slider and color wheel into a hex using a node the plugin provides, but I don't know how to convert a hex code that's inputted into the seperate values of the color wheel and the slider independant of each other, anyone have an idea of how I could do it?

frosty heron
#

also this

elfin hazel
frosty heron
#
float ACitySampleVehicleBase::GetWheelSlipAngleInDegrees(int WheelIndex) const
{
    if (const UChaosWheeledVehicleMovementComponent* MovementComponent = Cast<UChaosWheeledVehicleMovementComponent>(GetVehicleMovementComponent()))
    {        
        if (WheelIndex < MovementComponent->GetNumWheels())
        {
            return FMath::RadiansToDegrees(MovementComponent->GetWheelState(WheelIndex).SlipAngle);
        }
    }

    return 0.0f;
}
crystal crown
frosty heron
#

Do this for a start

elfin hazel
#

Right. And the wheelstate takes the wheelindex, then Get slip angle.

crystal crown
#

Thanks guys. Appreciate the help. I have a few problems tho.

frosty heron
elfin hazel
#

Connect the wheel index to the "Wheelindex" of the "Get wheel state" node. Drag off the "Get wheel state" return node, and type break. It should show a struct, with a bunch of variables. Look for the slip angle. Connect slip angle to R2D.

frosty heron
#

right click and split this

crystal crown
frosty heron
#

try break then

#

drag from it and type break

crystal crown
#

🤦‍♂️

frosty heron
#

you can prob split it, not sure if you doing it right

#

anyway break will get you the same thing

crystal crown
#

brake worked

frosty heron
#

Connect the SlipAngle from the break to the radianstoDegress

crystal crown
#

split selection was greyed out

frosty heron
#

and that should be it

crystal crown
#

Finally. Now what about the inputs and outputs in the event graph

frosty berry
#

How would you apporach having a ship enter the scene of your game like a start wars ship coming out of hyperspace? Like this:
https://www.youtube.com/watch?v=gWeOi909mNQ&t=6s
https://www.youtube.com/watch?v=SmCkEu-pSAs

frosty heron
#

we only translate the function that was pasted

elfin hazel
#

Yeah, now this function can be used anywhere you want. You might want to select the function and check the Pure checkbox.

fiery moon
crystal crown
frosty berry
elfin hazel
crystal crown
#

so i guess i don't need it

keen depot
#

Hi, I have question regarding VR in Unreal5, I am working on a project( not game) I did in unreal 4 where I use VR controllers but not really the headset. The problem in Unreal5 I noticed is that audio stops working and controller input buttons dont work when I dont have the headset on my head(the IR sensor sees I am not wearing the headset) . I started from the basic VR template but I dont see anything regarding get HMDWorn State. Anybody knows how you can disable this?

noble ledge
#

Does the Owning Object get set to something by default if nothing is given to it?

crystal crown
elfin hazel
crystal crown
#

How do i know which wheel is which index

elfin hazel
#

I am not sure, I've never use the vehicle template. Perhaps someone who uses chaos vehicles can chime in.

lunar sleet
crystal crown
#

alright. thanks for the help.

wheat flame
#

Hey, not sure if this is the right channel to ask but im having issues where my character is way too mobile while in the air, can anyone help me out with that?

crystal crown
wheat flame
#

Its my first time using any engine tbh but i think i have an ok base at the moment

dawn gazelle
wheat flame
#

Ya i tried editing that variable but it didnt do anything, ill try again once it installs on my steam deck or get home

elfin hazel
#

You'd have to call the node for each of the wheels that you want the spin of.

crystal crown
#

ah mb

tight pollen
#

any ideas on how to rename the key without changing its order?

lunar sleet
#

Lacking some context there

patent scaffold
frosty heron
#

To narrow it down, don't do input in your Bp_door or w/e.
Do the input in your character/controller

#

do the interaction using interface

patent scaffold
frosty heron
#

the bp door should implement the interface yes, and just call the Use event

#

the door don't need to know anything about the player

#

or the interaction mean

#

Character simply press Interact Button, then you can do line trace or w/e. If the hit actor implement the interface, then run it's Interacted/Use event

patent scaffold
#

yep got it that helps alot, thanks! Are interfaces the standard for these type of interactions?

frosty heron
#

the most two debated candidates for Interaction system is either Component or Interface afaik

lunar sleet
#

I mean cast works fine too

frosty heron
#

True, I try to keep it agnostic for interaction tho

lunar sleet
#

Fair

lunar sleet
#

Or the PC?

frosty heron
#

it can just be an actor right?

#

the target

patent scaffold
lunar sleet
frosty heron
#

pretty sure u just need the object

lunar sleet
#

I swear, with interfaces I always think I got it and then I’m like wait no that’s broken 😀

frosty heron
#

Object -> Use (msg)

lunar sleet
#

Ah ok,

#

Makes sense

frosty heron
#

if it implement the interface then it will just run the event in the object, otherwise does nothing

lunar sleet
#

Right, so you avoid the cast but still need the ref gotcha

frosty heron
#

I don't think interface is a way to avoid cast :S but maybe that's just me

dark drum
#

How do I add a camera shake? I can find the play world camera shake but I only want it for a specific player character.

frosty heron
#

can prob avoid casting for super generic stuff like calling an event

#

but when you need to grab some variable, you will need to cast . no way around it afaik

lunar sleet
#

So you get the ref, cast to… actor?

#

Or wdym by this

frosty heron
#

Line trace, hit actor -> Msg? i think that's how it go

#

haven't touch bp for long time 😥

lunar sleet
#

Haha, well you’re touching cpp so that’s ok😀

frosty heron
#

I'm almost done with my loading screen and character screen

#

eventually I have to re-do inventory/weapon system lol

lunar sleet
#

Nice, stealing from Lyra still? 😀

frosty heron
#

Nah I can't interpret anything

#

but the loading screen was allright

lunar sleet
#

That seems to be the common consensus 😃

frosty heron
#

@dark drum this work maybe

dark drum
frosty heron
#

for my fake loading screen

#

but now I get semi non fake loading screen, so I get to say good bye to that node

dark drum
frosty heron
tawny patio
#

Hey guys I have this condition on the left on paperZD that will play the attack animation if their X velocity is more than zero, but in only applies when im going the the right direction and wont on left direction. To the right is how the sprite turns using rotation but not sure what condition to have the attack animation play as well when im going to the left.

#

nvm somehow changing the "more than" to "not equal" fixed it : P

dawn gazelle
wild crater
#

So you can use multiple variables on one input in BP to call the function multiple times (not sure how it works). Is there a way to make custom functions that also work like this? Cause when I try it on my custom function it doesn't work.

dawn gazelle
past compass
#

Is it possible to change UDS (ultra dynamic sky/weather) with a widget in real-time?

Making like a menu screen and want to allow changing pretty much any variable of the UDS/weather system.

Not sure where to do this at tho , there’s a lot going on in the UDS plug-in

gentle urchin
#

More like ultra static /jk

wild crater
#

The use case atm is that we sometimes use this but I'd like to add a validity check to it to remove warnings.

dawn gazelle
# wild crater Yes

It only works for the "Target". You can't connect multiple values into the inputs of a function.

past compass
#

Would I need to cast to it? Or create an interface ?

wild crater
dawn gazelle
#

My guess would be yes, it's likley possible, but as I don't have it, I wouldn't be able to tell you how you could :/

past compass
toxic drift
#

I'm trying to implement a double jump where if I jump one direction, and the second jump is in a very different direction, it's like a sharp immediate redirection and momentum isn't carried over. I put in a "Stop movement immediately" node which works fine enough for when I jump forward and then double jump back the other way, but when I double jump in the same direction I did the first jump it feels really jank and rigid. Is there any way I could possible set it so the "Stop movement immediately" node will only fire if I input a double jump with the analog stick pushed in a noticeably different direction fromt he first jump? Like say more than a 75 degrees deviation from the initial jump for example.

obtuse geyser
#

Need quick help, I want this icon to pop up on TestingPawn (G key doesn't help)

toxic drift
#

I imagine I would just have to set up a variable that when I jump it set's the directional value for the first jump, and then when the second jump happens run a branch to compare the two but I'm not sure exactly where or how or what function I would pull the directional values from in the first place. (Still kinda new to all this)

sweet silo
#

hi there how can i create some sort of letterbox menu widget, you receive mail and it shows up first as a list and you can look at the items as you select them
thanks a lot

past compass
dawn gazelle
# sweet silo hi there how can i create some sort of letterbox menu widget, you receive mail a...

There is a listview widget. You populate the list using objects that you construct so they can have whatever data you need and you define a widget class to use in conjunction that the list view will display for you. Clicking on an item in the list gives you an event which you could then use to trigger more logic which also gives a reference to the object contained in that list item so you can pass the data to something else.

heavy lion
#

Say I wanted to return the value of the movement direction of a character inside a component, how would I go about doing that?

sweet silo
heavy lion
#

I have an Enum with moveLeft, MoveRight, MoveForward, MoveBackward.

dawn gazelle
heavy lion
#

But im not sure how to detect the movement direction itself

#

I would like to determine if W S A or D were pressed. But I just cant figure it out

#

I obviously cant hardcode it.

sweet silo
#

what's the proper way of getting out of the widget when the interact button is clicked again ?

#

thanks

lofty rapids
#

usually you create the widget elsewhere then add/remove when you need to
so you don't keep creating it.

dawn gazelle
sweet silo
lofty rapids
sweet silo
#

hmm ok like all the widgets in the hud ? thanks

lofty rapids
#

well you don't want to keep "creating" it over and over you'll probably end up with a bunch of them

#

so creating them once in the hud is nice, then you just get the hud, get the reference and add / remove

sweet silo
#

but i want to create it only when i intereact with this object in particular

lofty rapids
sweet silo
#

but yeah you are right i'd better do that

lofty rapids
#

right so when you create, promote to variable, don't add to viewport

#

then when you want to see it, get the reference, add to viewport

#

and when you want it to disappear, remove from parent

sweet silo
#

hmm cool so i should create some sort of a master widget where they all get referenced

lofty rapids
#

or you can use visibility

lofty rapids
#

kind of easy to get from anywhere

sweet silo
#

yeah definetly but the hud is just a regular widget named hud right

#

or there is something called hud like a player controller or smth

lofty rapids
sweet silo
#

oh ok !

lofty rapids
#

i mean yes it's a bp

#

but it's in the override as HUD

sweet silo
#

how can i acess it from the content browser ? or should i create a new one as a bp classe ,

#

thanks agian

lofty rapids
sweet silo
#

ok great thanks

#

found it

lofty rapids
#

yep HUD

#

add to viewport/remove from parent will reset the widget

heavy lion
#

@dawn gazelle That looks like what im after

lofty rapids
#

so you may want to use visibility instead

heavy lion
#

I am able to get the X and Y clamped to +/- 1

#

Now just need to figure out how to set it

sweet silo
#

what should i input as object here ?

#

i've tried a bunch but doesn't work

lofty rapids
sweet silo
#

ok i think i got it

#

oh ok thanks a lot:

heavy lion
#

@dawn gazelle Sort of working! XD

#

It only ever sets it to whichever was done last however

#

Or whichever is last in the sequence

dawn gazelle
lofty rapids
#

i feal like two seperate enum, will help you know if your going up/right, down/right, down, invalid etc...

heavy lion
#

Yeah thats what I was thinking. Two Enums, and a way of detecting which was triggered last.

dawn gazelle
#

If you do it based on whatever was last pushed, then you need to use something like the "Started" output from an Enhanced Input event, and that can directly set the appropriate enumerator based on the axis value, and the "Ended" or "Cancelled" output from the event can set the enumerator to None.

heavy lion
#

Might be easier to create a separate input action for forward and backwards and left and right???

#

Otherwise I have to determine which was pressed each time

dawn gazelle
#

It won't matter. You'll still get wonky behaviour...

lofty rapids
#

i mean with two enums, why would you have to figure out what happened last ?

#

you would just have an up/down, and left/right

dawn gazelle
#

If I press and hold W and then press S, one would expect "Backwards" to be the output. As soon as I release S, I'd end up getting "None" despite that I'm still holding W

heavy lion
#

@lofty rapids I only ever want one to be true. Cannot be forward and left at the same time for example.

heavy lion
dawn gazelle
#

I probably mixed it up.. You may want to still use "Triggered" if it's continually firing, then just have it set the appropriate enumerator.

teal nexus
#

I have a silly BP question

#

I am doing this to offset where VR teleport arc is coming from (hand). So, this contraption above moves it 20 units on the axis perpendicular to the palm of the hand.

#

I'd like to do the same thing for other 2 axes

#

So I did it for Up and Forward vectors, then added all 3 and ... my teleport arc disappeared competely 😛

#

How should it be done, correctly ?

dawn gazelle
#

Did you add them all with the world location added to the vector?

#

Or did you add the vectors with their multipliers to the world vector?

wild crater
#

That's what I was going to ask as well

#

You wanna make sure you calculate the relative offset in each direction. Add those into one offset, and apply that to the world location.

gentle urchin
#

Cant you combine the axis input into a vector directly ?

teal nexus
#

hmm.. I think I added them to world location, then added the results together.

dawn gazelle
#

(WorldLocation + RightVectorMultiplied) + (WorldLocation + UpVectorMultiplied) + (WorldLocation + ForwardVectorMultiplied)
vs.
(RightVectorMultiplied + UpVectorMultiplied + ForwardVectorMultiplied) + WorldLocation

wild crater
teal nexus
#

ugh

#

so, should it be this:

#

(RightVectorMultiplied + UpVectorMultiplied + ForwardVectorMultiplied) + WorldLocation

dawn gazelle
#

Yes

teal nexus
#

gotcha, thanks a bunch!

crystal crown
#

Why is my movement component not valid all of a sudden?

wild crater
#

Also consider whether it should be a component of/attached to the thing it's relatively located to. If it's always at this offset, that's probably the easiest solution. Or are you setting it just once while attached/as a component? (I'd think not as you're using world location)

wild crater
teal nexus
#

thanks, I'll try that too 😊

wild crater
# teal nexus thanks, I'll try that too 😊

Just some general advice, without being pedantic. Vector maths is probably the most useful maths to have a good understanding of when doing game development. I know it might suck, but I would recommend to just do some abstract exercises with it or test your own understanding of it by trying various things in engine and rendering all the steps/output.

sweet silo
#

hi any idea how i can make my vr hand collide with a box collision

#

the whole vrpawn is colliding

wild crater
#

You can make an entire game with just basic algebra and vector math.

wild crater
heavy lion
#

@dawn gazelle I managed to solve it with a spaghetti junction like setup!

#

This works as I expect it to work

#

Both values reset to 0 when you let go of WSA or D so it resets the movement to invalid (Which is what I want)

#

Now I need to calulate look direction

mystic edge
#

Hey, im trying to subtract 0.1 from my float Hunger and return it. Only problem is, that I cant return it with the same name. Im new to UE5 and I tried using the _Set to variable option, but with that I cant use the same name. (Its a hunger system for a video game by the way)

heavy lion
#

Drag the out pin to the return node

#

Give the value on the return node some new name.
(NewHunger)

#

Oh wait

#

Drag hunger from the variable list whilst holding alt

#

That will allow you to set it

mystic edge
heavy lion
#

No problemo

lofty rapids
#

you can also just drag it, and hit set

lunar sleet
keen ravine
#

I have a button in a widget.
It should be enabled or disabled depending on a parameter inside the component of character.
Which option is better:

  1. Bind to a property in the component (Widget binding)
  2. Create an Event Dispatcher inside the component and bind to it? (Event binding)
scarlet timber
gleaming relic
#

hey, im trying to change the tint of a widgets style via blueprint, how can I do this?

#

I got a reference of the widget and got it's style, but idk how to change the tint specifically

#

I've kinda figured it out but this just looks like a spaghetti way to do it

dreamy mountain
#

do ui elements go in firstpersoncharacter, firstpersongamemode or firstp[ersonplayercontroller?

novel rock
#

how do i make an multi animation selection by index?

frosty heron
#

@novel rock

novel rock
dreamy mountain
#

i dont have one called hud

lunar sleet
#

Make one

marble tusk
lunar sleet
young meteor
#

Any idea where I can set a custom snapping value for UI elements?

#

In editor preferences I can see a bunch of options, but none seem to have the values in the first screenshot

#

(screenshot is from "Level Editor" -> "Viewports" section)

steady night
#

why is it acting like this :/

hasty bay
#

Hi,
I am modding a UE4.27 based game and was trying to add settings items to the game using the game native widgets.
The code in C++ is using UClass::FindFunctionByName to get the value and write the value.
Usually each settings panel used a c++ class that contained all these function.
I tried to create a BP extending the base c++ class and added functions to it but it seems the game doesn't use them.
Using x64dbg, I can confirm that UClass::FindFunctionByName returns null pointer and thus it doesn't get called.
So, my question is this, does UClass::FindFunctionByName works on blueprint generated classes and I am doing something wrong or it doesn't work like that?
PS, the uasset already contains the funcmap with all the functions correctly listed.

#

Not sure if this should be asked in cpp channel, since it is mix of both.

scarlet timber
signal perch
#

how do I change the font according to the language?

hasty bay
#

You can still call a BP function using call checked or something to communicate back but I think that one is for objects not classes

frosty heron
#

what game are you modding?

#

afaik the topic is discouraged/forbidden unless you have permission from the game creator

hasty bay
#

Payday 3. The developer is already cool with modding and encouraged it in Payday 2.
But the question can be asked without any modding references.

hasty bay
whole ivy
#

hello, first time asking here, i want to disable manual input but letting AI input goes through in my BP. it's for having the player at another location at the end of my cinematic.. i thought it should be simple but can't make it works.. thanks

scarlet timber
naive stream
naive stream
#

exactly

whole ivy
#

here is the thing i am trying to do :

naive stream
#

which isn't callable from blueprints

lunar sleet
naive stream
#

they wouldn't have to write or use C++, just create a class

#

i could make a plugin but cba

whole ivy
#

the simple move to location node use AIcontroller to move the player, but when i disable movement input in the level sequence player it disable that movement too.

novel rock
#

I can instance and store a variable but how to I destroy it?

lunar sleet
lunar sleet
novel rock
#

Although I don't see the Music Cue in the world outliner

lunar sleet
novel rock
lunar sleet
rose dew
#

hellow

#

how should i do that ?

modern radish
#

any idea why this would only print updated values when click-dragging? not when I freely move the mouse?

#

I get the same value even if I move the mouse

trim matrix
#

Do u have it set to showing the mouse cursor?

#

@modern radish

lunar sleet
modern radish
#

Have this on my player controller

trim matrix
#

instead of game only

modern radish
#

doesn't work either.. and that also breaks my game it looks like 😄

#

@trim matrix

trim matrix
#

try making it not consume input

modern radish
#

I have some click-drag functonality

modern radish
trim matrix
#

should be on the node

modern radish
trim matrix
#

uncheck the hide cursor during capture maybe?

lofty rapids
rose dew
trim matrix
lunar sleet
# rose dew

Ok, so then why are you trying to use an actor reference to cast to whatever that is?

modern radish
modern radish
lunar sleet
lunar sleet
#

Seems to be a common occurrence

lofty rapids
#

did you set in the project settings to capture on click ?

#

don't know if that would matter but worth a look

modern radish
trim matrix
#

Edit>Project Settings

rose dew
modern radish
lunar sleet
#

Player controller?

lofty rapids
trim matrix
#

or search up

rose dew
trim matrix
lunar sleet
lofty rapids
#

worth a check

modern radish
#

this might be it

lofty rapids
#

ya should be fine ig

#

idk if that would even matter lol

trim matrix
#

it could matter

modern radish
#

I changed to be the same as yours but no luck lol

lunar sleet
#

I’ve seen this issue often but I can’t rmbr the actual fix 😅

lunar sleet
modern radish
lunar sleet
#

Like where is that, on begin play? What’s before it

modern radish
#

oh good idea, let me try that

rose dew
lunar sleet
#

There’s an onComponentBeginOverlap you can use instead (select one of the components in this bp like mesh, scroll down in details panel), and grab from other component and feed it that ref

modern radish
trim matrix
#

What's the flush input for?

modern radish
lunar sleet
#

tested it and it works fine on my end

#

but hang on

#

why are you getting player controller

#

this should be in the PC

#

what are these shenanigans ? 😄

modern radish
trim matrix
#

it should work nonetheless

modern radish
#

that doesn;'t work either

trim matrix
#

yeah

lunar sleet
trim matrix
#

something else is the problem

lunar sleet
#

try this

#

in that order

trim matrix
#

huh

#

won't that overwrite the input mode?

lunar sleet
#

I had to do that to fix a no focus on window issue when first starting the game

#

mind you mine was the have to click once to register

modern radish
#

I tried it, same results.. Even if I focus the screen before hand

trim matrix
#

yep...

modern radish
#

if this was a focus problem, it would start updating after I clicked the first time, but it doesn't.. it stops and prints the same number where it stopped

lunar sleet
#

show your tick again pls

#

and just to confirm, you're not doing multiplayer stuff right?

lofty rapids
modern radish
lunar sleet
#

it doesn't need the self target but that should work

modern radish
#

Yes, I tried running it here in the controlelr BP, also elsewhere, same thing

lunar sleet
#

nothing prints?

modern radish
#

no multiplayer..

lunar sleet
#

did you restart engine just for our collective sanity?

trim matrix
modern radish
#

it prints, but only the same number

trim matrix
#

in the controller

modern radish
#

let;s try that, restart engine!

lunar sleet
#

I have this on tick and works np:

trim matrix
#

there's prob some weird option or something which u have enabled

modern radish
#

Must be that indeed

#

I restarted, but same results

lunar sleet
#

could be UI function related

#

do you have something handling cursor hover/click within UMG?

modern radish
#

I do have some UI stuff, let me try removing all

#

removed all the UI, same thing, I'm going mad LOL

trim matrix
lunar sleet
#

no OnMouseButtonDown or anything eh?

#

crazy

modern radish
#

that's all it prints if I dont click and move the mouse around

lunar sleet
#

what's your default player controller set to ?

modern radish
lunar sleet
#

no, no, in world settings

#

or maps & modes

trim matrix
#

it wouldn't be printing i think

#

if it wasn't the right one

lunar sleet
modern radish
#

on that map specifically where my game occurs

trim matrix
#

would i?

lunar sleet
#

the engine likes to throw all kinds of curve balls imo

modern radish
#

it's my BP COntroller

trim matrix
#

but not like that

lofty rapids
lunar sleet
#

I rmbr having some similar issue when I made my main menu level, but iirc that was just me having to add the show mouse cursor

modern radish
trim matrix
modern radish
#

my mopuse is functional for the game.. like I can click and cli-drag to interact with my objects

#

the only thing is that I cant get the mouse position on tick, whcih I wanted to do some parallax effect with the camera

lofty rapids
trim matrix
#

they would still need to do that through the controller

#

so there would be no difference

modern radish
#

🤔

trim matrix
#

🤔

#

maybe u could do that with some other node

modern radish
#

could this be related?

trim matrix
#

like get mouse on viewport

modern radish
#

it updates on tick

trim matrix
#

lo

sweet silo
#

hi there

trim matrix
#

l

sweet silo
#

what's the right way of doing that

#

i want to be able to close the widget and go back to normal when the playyer interacts again

lunar sleet
lofty rapids
gentle urchin
#

Isnt there a consume mouse on drag or smth

#

Which locks its position?

sweet silo
modern radish
trim matrix
lunar sleet
lofty rapids
lunar sleet
#

The system you’re using is deprecated

modern radish
#

Oh okay, my project started on 4.26

#

and i'm on 5.3 now

gentle urchin
lunar sleet
#

Should consider switching at some point when good and ready

trim matrix
lunar sleet
modern radish
trim matrix
#

a different input handling

lunar sleet
modern radish
#

my only input in the game is the mouse lol

sweet silo
trim matrix
sweet silo
#

and how can i do remove from parent if my widget is inside the show widget

#

here is my show widget maybe i'm wrong

lofty rapids
#

ya you don't want to keep creating the widget like that

lunar sleet
trim matrix
#

@modern radish but if u found that mouse pos on viewport works for u then just use it instead

lofty rapids
#

you create somewhere like the hud, and then reference it

sweet silo
#

this is inside the hub

modern radish
sweet silo
lofty rapids
#

in your hud on begin you just want to create and promote

#

so that when you get HUD, and cast, you can get the reference

sweet silo
#

and this is inside the object i'm intreracting with

trim matrix
sweet silo
#

got it thanks

modern radish
sweet silo
trim matrix
sweet silo
#

because it's asking for a widget class

frosty berry
#

Looking for the right node. I want to pas a number in and fire off that number of pins in order. So if I have a "node" with 6 pins and pass a 3, the first three should run in order. Thoughts?

lofty rapids
#

the one you want to show/hide

trim matrix
sweet silo
#

ah but then i need to create a different one for each new widget 'im using? @lofty rapids

trim matrix
#

if not then i'll show u a very quirky way

modern radish
#

unless there's some other math involved I'm missing

lofty rapids
#

theres also this

trim matrix
#

I'm afraid that won't work

lofty rapids
#

sux it works well

trim matrix
#

due to the previous node not working

lofty rapids
#

thats what i was wondering also

modern radish
#

actually wait, I think the previous Deproject thing is correct

#

but I need to account for the camera position perhaps

trim matrix
#

maybe, but i think u also need to scale the mouse pos

#

by get viewport scale

sweet silo
#

like this i guess

lofty rapids
#

then you set visibility, or add/remove it

trim matrix
sweet silo
#

but isn't it bad perf wise to have stuff declared like this ? like semi open all the time?

lofty rapids
#

ig you could invalidate the reference if you don't need it

trim matrix
sweet silo
#

hahahah

#

true

#

my computer is in the 60"s though

primal schooner
#

Anyone know why OnHealthChangedEvent (the blue one) gets called correctly with NewHealth at 100, then it immediately calls OnHealthChanged_Event (the red one) and NewHealth is set to 0? Trying to initialize the health to 0 using the change event.

SideNote: this honestly feels weird anyway. The pattern I'm used to is you always have your change events, and an initialize function. And you init in initialize and you change in your change events. But in Unreal I've only seen people do it this way so that's what I'm trying.

sweet silo
#

and by the way why isn't this working ? what's the right way of doing it ?

lofty rapids
trim matrix
#

It has default value of true (i think it should be false)

lofty rapids
#

well if true set true, if false set false ?

#

idk if that's what you want to do

sweet silo
#

i've tried many combinations it was just the last one i tried

#

sorry
I just want to be able to get out of this widget by interacting again

lofty rapids
#

are you using has interacted anywhere else ?

sweet silo
#

but maybe it's impossible since i'm using interafaces

lofty rapids
sweet silo
#

yeah actually tha'ts my issue i guess i can"'t interact with the object again since i'm in ui mode only

lofty rapids
sweet silo
#

yeah i changed that since sorry

daring bison
sweet silo
#

ok thanks i'll try

primal schooner
daring bison
primal schooner
#

Yeah its being called right there

daring bison
#

Nowhere else?

primal schooner
#

doesn't appear to be, I have a breakpoint on the red event and its only hit once

daring bison
#

So what is the health changed signal for if you call the event directly anyway?

primal schooner
#

Ah I see what you mean. I do call it in code though I'm realizing that's not working either..

#
DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FHealthChangedSignal, AActor*, InstigatorActor, UARLAttributeComponent*, OwningComp, float, NewHealth, float, DeltaHealth);
void UARLAttributeComponent::MulticastHealthChanged_Implementation(AActor* InstigatorActor, float NewHealth, float DeltaHealth)
{
    HealthChangedSignal.Broadcast(InstigatorActor, this, NewHealth, DeltaHealth);
}
#

i think I'm missing something pretty fundamental. I'm not sure how blueprint is supposed to know that HealthChangedSignal.Broadcast calls

#

oh its the binding right

daring bison
#

Anything that calls the signal will fire the event

primal schooner
#

Yeah, that makes sense. But in this case, OnHealthChanged should only be called once because i'm only changing the health on initialization

#

and the initialization event, is sending 100

#

but its being received as 0

lunar sleet
primal schooner
#

hmm.. does blueprint have a callstack?

#

or does it show me where something came from?

lunar sleet
#

You don’t know where you’re calling it from? Ctrl+F hit the binoculars and search

primal schooner
#

well the only call in this blueprint is that screenshot

lunar sleet
#

That’s not a call

primal schooner
#

oh i see

lunar sleet
#

Show where you’re calling it

#

What you have in this bp are a bind to a dispatcher event and the custom event that’s bound to it.

#

The call that triggers the bind is happening somewhere else

daring bison
#

Is this not a call to the event?

primal schooner
#

sec

#

Okay so that's all the references

#

I had that just sitting out there in another blueprint

#

when I remove it, the hp updates properly

daring bison
#

wtf

primal schooner
#

how on earth could that thing that's not connected to anything cause this problem

lunar sleet
daring bison
#

Restart UE

#

A lot of things are fixed that way xd

primal schooner
primal schooner
daring bison
#

I get a lot of compile errors that dissapear after a restart

#

Curse of a bp only game I guess

primal schooner
#

btw, what is a good time to do initialization for things like this? Is BeginPlay usually a good spot?

novel rock
#

Is "Is Valid" like If(null)?

daring bison
#

That wholly depends on your game

primal schooner
#

okay

lunar sleet
#

If != nullptr

daring bison
#

Personally I like to avoid begin play for most things init because its an event and not a function

#

harder to bugfix stuff imo

lunar sleet
#

I mean it works for some things but it doesn’t have a reliable trigger timeline, so for some things you’ll need to be more specific

primal schooner
#

Well since I'm in an UActorComponent, and also its replicated, I was debating between InitializeComponent BeginPlay or ReadyForReplication

#

But I think in this case.. BeginPlay is probably safest..

#

though honestly maybe I just expose an Initialize function in my component that just fires a changed signal for every attribute, and the owner can call it when its ready to initialize

gentle urchin
lunar sleet
whole ivy
#

i've finally resolved my problem of disabling and enabling input during my cinematic, this is the final code if that may help anyone

#

tldr, disabled input for the Playercharacter then re enabling it after a delay that is equal to the length of the level sequence

lunar sleet
#

I did correct this to removing mapping context mind you

#

Since that’s more accurate with the new input system anyways

#

But glad you got it solved!

whole ivy
#

i will read about mapping context and change to that later

lunar sleet
#

You’ll need the EnableInput again if you ever try to add input to a regular actor (not character)