#blueprint

402296 messages ยท Page 833 of 403

dark crow
#

HUD is not supposed to be replicated

trim matrix
#

ok

dark crow
#

You can instead access everyone's HUD from the Array of PS with the Controller and update the value like that

trim matrix
#

oh

dark crow
#

One of the only times GetPlayerController with Index is useful in a networked situation, in the GameState

trim matrix
#

if I need the number on the HUD to move up in a counter like fashion. Do I bind it? because I saw a YT video that says it updates every tick and that's not good or something

weak zealot
#

Rather than my rotation going from 0 to 360, then looping back.. which is what i need, it's going into the negatives.. makes it quite hard to calculate

dark crow
#

Cause if you iterate all PS, you can access all PC like that

trim matrix
#

oh

#

ok

feral ice
#

Does anyone know how to get an instanced position? I want the instnaced mesh that gets rolled over to set its location to a lower value in the z axis. Sorry for my wack english im tired haha. But i just want the mesh to get a lower value so it looks like it got rick rolled over :D.

gentle urchin
#

Get instance transform

#

So from the cast -> get instance transform -> subtract your z and update it

#

Carefull not the mark renderstate dirty more than once per tick

#

Its an expensive operation, especially at volumes

feral ice
#

i see artheur told me to use and im still a bit confused at what it does

gentle urchin
#

Updates the rendered meshes

#

I suppose that means sending the new transform array to the gpu or smth

feral ice
#

ok but i do need that ticked if i want to change an instances location?

gentle urchin
#

If you want it to show, yes

#

But if you roll over several instances on a frame,

#

You only need want to mark it dirty once

feral ice
#

so if i do it each second it would update all the ones it had run over and set the new location on them all

gentle urchin
#

It will update their appearance yes. Their actual transforms will update regardless , not sure about their collision state

feral ice
#

hmm interesting. I would need it to update fast but maybe not as fast as i am doing right now

gentle urchin
#

The more instances you got in the hit component the worde it gets

#

If this is foliage im not sure how thats handled in that regard

#

If it automatically divides it at somr generic instance amount or if it just keeps piling on..

feral ice
#

ok

#

this is the setup atm but like they all get a large lower value

#

this is good but i wanna have more control do i need a value a little bit lower than 1

gentle urchin
#

You could lay them flat in the direction they got rolled over ๐Ÿ˜„

feral ice
#

hmm what do you mean?

gentle urchin
#

You can update their rotations

#

So they are like 80 degrees tilted in the direction they got rolled over

#

And perhaps scaled to .8 or smth

#

Idk, perhaps dumb idea

feral ice
#

yeah i see what you mean

tranquil abyss
#

So I have a little text widget that displays the name of the item the player is standing over/on

#

it works but the problem is

#

It will display the names over all the items of that class or parents untill I walk over all the item currently in the world

#

then it works properly

#

any idea how to make this only display over the single actor

#

before vs after walking over them

#

all of them*

#

Also tried this (not hooked up atm)

sturdy herald
#

@tawdry basalt Maked a mistake here.
The timeline playrate not fine yet becauseif the start Z value is negative and the find look at rot Z positive (or first pos 2nd negativ) then the difference will be not good. Resolved this with this macro. Simply checked if both of them are positive or negative, if yes then subtract the output from input if not, then add them (with this we will get 90 with 10,100 values and -40,50 values too).
https://blueprintue.com/blueprint/e_4w2-fc/

dawn gazelle
tranquil abyss
#

maybe this guy instead?

#

lol that makes it so everything but what im standing on shows

tawdry surge
#

I gotta make an asset randomizer for an in-game store today. i.e. Every so often the options displayed in the store widget change and allow the player to buy different things.
I was considering making one class for weapons and setting the mesh and stats from a data table or data asset.
Other method I'm considering is make each weapon a child class and just use get derived classes to populate a list of possible options and spawn them from there
Thoughts?

maiden wadi
#

@tranquil abyss HiddenInGame needs set to true by default for the component.

#

Also don't mess with the literal Visibility unless you really need to. Try to avoid it where possible because it's a replicated state. HiddenInGame achieves the same thing and is not a replicated property.

tranquil abyss
#

gotcha

tranquil abyss
dawn gazelle
tranquil abyss
#

like the visibility setting for the widget

dawn gazelle
#

If you have it set up like this, then you're only showing or hiding the component if the player overlaps and ends overlap. The "Hidden in Game" value should be set true on the component by default as both I and Authaer mentioned.

tranquil abyss
#

am I missing something

#

just to make sure im not crazy this was the original

maiden wadi
#

Click Widget, go to details, check HiddenInGame.

tranquil abyss
#

ohh

maiden wadi
#

That sets it's state to true by default. So it's invisible when you start playing. That makes it so you don't have to overlap it first to set it's hiddeningame to false on end overrlap before it actually hides.

tranquil abyss
#

the widget in the class its self

#

im dump

maiden wadi
#

You have three different visibility settings when messing with WidgetComponents. SceneComponent has Visibility and HiddenInGame, and the widget it's holding also has it's own ESlateVisibility settings that can hide the widget itself.

tranquil abyss
#

test

#

that was weird My message was getting blocked

#

?? im trying to upload a pic in the engine

#

weird

#

Anyways. It works

#

but a bug if I stand on 2 items it displays the same name for both

#

that wont happen very often I dont think but still a bug

pseudo tendon
#

Totally basic UE BP question - but how do I create folders in the Variables section? ("My Character" and "Components" seen here.)

maiden wadi
#

WTB way to not have variables in folders. ๐Ÿ˜ฆ Passing components to widgets is annoying.

vital aspen
#

Does anyone have an idea for a build system. Something lay down foundations and so on.

#

Oh, and I'll be in the Lounge channel

sturdy herald
hearty barn
spark steppe
#

either make an event which takes the actor as parameter

#

or put them all in an array and iterate over it in the timeline update

weak zealot
#

I'm trying to compare a set of numbers based on my objects rotation, but my object rotation is super out of wack, i tried using a clamp axis so it'd go from 0-360 but it's making zero sense still

maiden wadi
#

<@&213101288538374145>

weak zealot
#

Are videos not allowed?

maiden wadi
#

Wasn't for you.

weak zealot
#

Ah, whew.

maiden wadi
#

You'll get a warning and severely mocked before you get mods called on you most times in here. ๐Ÿ˜„

maiden wadi
#

Mod tag was for the discord nitro spammers.

spark steppe
#

your way to rotate the stuff is... not optimal

#

delay of 0.1 is 10fps

weak zealot
#

yeah, it's just so i could visualize the number easier

#

i'll remove it once i have this fixed

spark steppe
#

how do you rotate the wheel?

hearty barn
weak zealot
spark steppe
#

thanks, i hate it

#

you should show the whole graph setup which is involved in that rotation stuff, as i can't yet twist my head around what you are doing

#

and i would use setRotation instead of addRotation, later might flip some axis which would lead to your result

weak zealot
#

I'm not wise enough yet to even spot the problem lol, for sure though

weak zealot
#

Spoiler(ered) for gore /j

spark steppe
#

you are setting local/relative rotation, but you compare world rotation

#

don't do that

#

either one or the other, considering the use case you may use relative/local rotation everywhere

weak zealot
weary thorn
#

so like, on this branch, i have the same functions copy pasted, and when its false it works, and when its true it says target variable has accessed none so does nothing and gives me an error

weak zealot
weary thorn
#

what in the blueprint is going on

spark steppe
#

does it still happen if you compare against relative rotation?

weak zealot
hearty barn
spark steppe
#

get relative rotation probably

tawdry surge
weak zealot
spark steppe
#

well then take that and split the transform

#

for now

#

honestly i'm not sure if local rotation is relative rotation (but i guess it is)

maiden wadi
hearty barn
#

in the previous picture you were passing in a target variable but in this screenshot I don't see it being passed in?

spark steppe
#

he wasn't passing it

#

target is what the function/event is called on

weary thorn
#

for some reason it works no problem when the branch hits false

#

thats where im getting confused at

hearty barn
#

ah my bad yeah it's an event not a function and hmmm

#

is it possible the event is getting called more than once? maybe add an is valid?

weak zealot
#

Yup, still acting quite odd. Might be what you said though, adding instead of setting. The way it's acting currently, it can never reach 90 to 135

weary thorn
#

ok, so i have changed the names a bit to clear things up

weak zealot
spark steppe
#

are you setting the target reference correct on the button which has the name "Yes"

weary thorn
#

so have a look now

#

i think actually showing you guys this has made me realise my issue

white bone
#

I'm new to blueprints and UE in general, does anyone know any good tutorials for beginners on key press events that play animations on characters?

weary thorn
#

on the first image of the three i belive i have not casted to all of the buttons

hearty barn
#

that's usually what does it for me xD

weary thorn
#

just the initial one on the first index (0)

hearty barn
#

ah yep get child at 0 only does the 0 index if you have multiple

white bone
#

when i try doing a play animation it doesn't do anything when I try to press the button I set to for the event

weary thorn
#

i love how explaining things can sometimes help you see the issues

#

thanks for being there and asking questions about my issue!

white bone
#

Is it possible to set a key press event inside of a metahuman blueprint? Like if the metahuman is the playable character then is it possible to make an event that triggers one of the character's animations when a keyboard key is pressed?

#

I tried to set up the event in there but it doesn't give me the option

#

Like one of these action events; how do I use that?

tawdry surge
#

@maiden wadi Just to clarify, you'd do the child classes with a data asset over a data table and single item class?

maiden wadi
#

Single class with a data asset would be my preference.

tawdry surge
#

I'm confused.
How would that work for populating a store front and spawning the items?

hearty barn
#

@spark steppe well good news is this works but only on the last ones called so child 1 it works but not child 0 and so on so if there were 63 it would only work on the last one

maiden wadi
tawdry surge
#

It's a faux website like Amazon the player accesses to buy items that will then be air dropped into the world.
I need to be able to randomize which items are currently displayed on the website widget and use the choice to spawn the corresponding item

spark steppe
#

guess the timeline which gets evaluated is the same for all

#

but i'm not 100% sure on this

hearty barn
#

yeah i think your right I'd need a separate timeline for each group of objects I wish I could like instance timelines so have a parent type of timeline and then instance one for each loop

spark steppe
#

you had two timelines before because the 2nd row should run with a delay?

maiden wadi
hearty barn
#

yeah each row essentially does the exact same thing (copy pasted timelines) but with offsets for delay

grand oasis
#

Hello, how would I go about getting a players relation to spot in a spline maybe this picture helps? :

mild crystal
#

can someone give me a idea to calculate the distance between 2 objects pls. I want to do one thing and need help. When i press the punch button i wanna to move the character close to the point that he gonna hit. Is it possible?

hearty barn
mild crystal
#

thx

main lake
#

Why does this print decimal value instead of 1, 2, 3, 4 ....

tawdry surge
#

Truncate it before you print it

main lake
#

it keeps printing 0 multiple times

tawdry surge
#

It'll print 0 till the value is 1.0 or above

grand oasis
#

What does it print if the time node is plugged directly

main lake
#

it prints decimal values

grand oasis
#

I think it's a constant

mild crystal
#

thx, i made this

main lake
#

and yeah after a bit of time it goes above 1

mild crystal
# mild crystal

but now i want to move characther to the cilinder location. how do i do that?

main lake
#

but I don't know how to use the Curve I made for my timer still. Like I have my max value on the curve being at 900 sec and its value is 23 (11PM).
And at 300 sec (6AM) I need it to go faster so I don't know how to work with those values

tawdry surge
#

@maiden wadiDon't tags just maintain a data table and check against it?

hearty barn
#

@spark steppe well I sorta found a work around using the event style but just in a node grouping copy and pasting it seems to be functioning and it's not too bad manually connecting them to the pins at least

mild crystal
#

how do i move my character to a location?

trim matrix
#

heya, quick question is there any way I can replay a BP's functions? like after my ball goes across the goal I want it to replay the same delay into randomly thrown movement.

#

what I have now is when it goes across the goal it sets off a custom event to be set back at it's original location with set actor location

grand oasis
#

For anyone wanting to know the location on a spline closest to point; Tags closest to Player, Spline, Rotate, look at

#

I couldn't find it on google

tranquil abyss
#

What is the blueprint to completely disable a Blueprint widget

#

compenent

grand oasis
main lake
#

Is it possible to have a switch case on the Box Collisions I dropped in the world and use "Get All Actors of Class" and I want to compare the output array with some tags and depending the tag on the box collision i want to execute some different code

dawn gazelle
dawn gazelle
main lake
tranquil abyss
#

So I have this logic to show the name of weapon when the player is standing over it, It works the problem is when I hold the weapon in my hand it shows the name still, I added the cast to and the branch to not show it, That works only issue is the widget is still overriding the othe widgets that im standing over.

#

if I swing it resets and the color displays correctly

#

Hope this makes sense

dawn gazelle
tranquil abyss
#

and also it sometime still shows the sword in my hands name

#

(Equipped weapon )

dawn gazelle
# tranquil abyss So I have this logic to show the name of weapon when the player is standing over...

I think you need to separate out your logic a bit better...
OnActorBeginOverlap > If Character's Equipped Weapon == self > FALSE > Set Hidden if "Overlapped Actors" doesn't contain player--- hard to understand.
vs.
If Character's equipped weapon == self > set hidden true (as I imagine the name should never display if equipped and it happens to end an overlap, but overlaps with your character again).

You may also want to call a function that sets it hidden when it gets equipped as the OnOverlapEnd event may not get called when you attach it to your player to try and set it hidden.

tranquil abyss
#

๐Ÿง 

#

ill need to make a function in the player ig

#

when the item get set as equipped

dawn gazelle
# main lake how ?

On BeginPlay of the actors. You can call GetGameMode cast to your game mode, add themselves to an array, or call functions in the game mode to do whatever Again, doesn't seem like it would normally be something you really need in the game mode directly. What are these triggers supposed to do?

main lake
dawn gazelle
# main lake I need to enable and disable them at certain time and as it's a multiplayer game...

Actors can maintain themselves based on events - all gameplay logic does not need to be in the game mode for multiplayer. It can actually be much more cumbersome to deal with if you have your game mode handling things that it doesn't need to. If you have a manager that handles time within your game mode, that's fine.... Have it call an event dispatcher when something needs to happen, and create your own trigger actors that bind to it on their begin play... Further to this, in your game state create a function or event that takes a Name or gameplaytag as input that you can then call from the triggers when they are triggered - feed in a tag or gameplay tag that you set on the triggers when they are capable of being triggered. In the gamestate, handle the event, and switch on name or gameplay tag and then you can do whatever you need to do, and if anything needs to be replicated to players you're in a decent spot to do so as well.

So now, you just need to place your trigger actors, they automatically bind to the time when placed so they can be enabled and disabled, and when enabled and triggered they'll pass on the event to the game state to handle whatever needs to handle, and perhaps notify players that the thing was triggered.

#

And sorry, I don't like to work in DMs.. If you have questions, your best bet is to ask them here.

grand oasis
#

What is Ue4's equivalent to Slerp?

#

I want to emulate Lag like the spring arm

#

Never mind it's Vinterp

main lake
dawn gazelle
#

What's the inaccuracy currently?

main lake
#

my day has to be exactly 10 min (so from 6 AM to 11 PM it has to be 10 IRL min) and the night exactly 5 IRL min (from 11PM to 6 AM) and my timer is at 10 min when it's 10:50 PM instead of 11 PM and 5 min when it's 6:40 AM instead of 6 AM

#

like the 10 and 5 min are variables and from that I calculate a ratio to use in the SetTimerByEvent

trim matrix
#

How come my score doesn't count up?

#

it stays at 1 every time

#

it doesn't count up

main lake
trim matrix
main lake
#

You add 0 to 1 all time that's why

trim matrix
#

oooooh

#

how do I keep the score then?

#

I should get rid of that

main lake
#

remove the argument from the event

trim matrix
#

right?

#

ok

main lake
#

and just drag your score variable and drag it above the + 1 (where you have the "Add Score" thing)

trim matrix
#

it worked

#

thank you

dawn gazelle
#

ie. What's keeping track of the time right now?

chrome nymph
#

is there a way to pass parameters to events?

#

i have a Parent who can collect many orbs.
the orbs can decide to leave the parent

the parent therefore needs to know which orb has left

#

the parent stores an array of orbs, and the orbs have a parent property to know who its currently attached to.

#

is there a way to get the orb to inform its parent that hey i left?

dawn gazelle
chrome nymph
#

or better yet - can i make the Orb's Anchor property be a publisher? so whenever the anchor property changes - it always invokes a stream ala ReactiveX

weak zealot
#

For some reason my get arrays aren't updating, always staying at the same value.. are they only being ran once? (Connected to a branch at the end)

chrome nymph
#

makes for a unidirectional flow

weak zealot
dawn gazelle
#

Like you want an event when the value changes? There's nothing really like that...If you're setting the value, then you can also call whatever you need to from there usually. If you wanted to use an event dispatcher, that's an option, but then you have to have your parent bind before calling it.

chrome nymph
#

(swift syntax, apologies)

struct Parent {
  var children: Array<Child>
  var subscribers: Set<AnyCancellable>

  func attachChild(_ child: Child) {
    children.append(child)
    child.anchor = self
    child.$anchor
      .sink {
          if let newValue = $0, newValue != self {
            children.remove(child)
          } else if newValue == nil {
            children.remove(child)
          }
       }
        .store(in: &subscribers)
  }
}

struct Child {
  var anchor: CurrentValueSubject<Parent?>
}
#

$anchor refers to the stream of the child's current value.

#

sink = setup a subscription to the stream

#

store = a way to keep the subscription pointer around so that it doesnt get deallocated (swift uses reference counting)

#

this code says - parent observes child's anchor property - if it changes and its no longer the parent, then the parent says ok i update my array to remove the child.

#

(i have never tried C++ yet so im not sure if this is even possible - but it seems like there is RXCPP so there might be some notion of reactive programming)

dawn gazelle
#

I think event dispatcher is what would be similar, but it doesn't automatically broadcast - you have to call them whenever you want them to fire so you could have a setter function set up that you ensure you use and in that function you set the value of the variable and call the event dispatcher.... But then the issue is again you need to bind and unbind from the dispatcher as well which would need to be handled within the object receiving the event before the event is called. You could maybe manage something like that in C++, but nothing like that in blueprints.

chrome nymph
#

hmm

#

what would be the simplest way to handle this in blueprints?

dawn gazelle
#

Well your orbs know your parent already.... So call function on parent prior to setting parent to None.

chrome nymph
#

i see

#

the code above is actually a bad example - usually the child shouldnt know its Parent - should be a protocol (aka interface in C++?)

#

to remove cyclic dependencies

#

but i digress haha probably trying to over engineer blueprints here

dawn gazelle
#

Well, it is good to have decoupled code.... I was thinking about an interface as well, just in case you wanted to have different classes interacting with your orbs.

chrome nymph
#

aye

chrome nymph
#

hard to resist "this is bad code" instinct heh

#

also - is this the wrong way to use generics in macros?

#

was trying to make a generic Find Nearest Actor function

#

seems to not return the value at all

#

... am i overreaching by diving into generics straight away :X

hollow inlet
#

what is it ticking on?

chrome nymph
#

event tick

hollow inlet
#

i see, but what class is that event tick on

chrome nymph
#

i have 3 classes

BP_NPC (contains OrbCollector component)
BP_OrbCollector (a scene component)
BP_Orb

the event ticks on BP_OrbCollector

hollow inlet
#

oh the function also.. sorry, there's a lot there, I don't see it off hand

chrome nymph
#

BP_OrbCollector invokes Find Nearest Actor in its event tick

hollow inlet
#

well, you see the log?

#

you've probably got a pin set wrong somewhere

dapper perch
#

does anyone know why my montage is playing indefinately? figured this is more of a blueprint question

#

nevermind im dumb, i was calling the montage again in my animation notify state

#

copy pasta errors are fun

wintry gazelle
#

Is it not possible to make a bp function's return type be a set?

tawdry surge
#

Love pasta errors

dapper perch
#

they are the best

wintry gazelle
# dawn gazelle ?

When changing the variable type it only allows me to change it to either a single or array. both set and map are greyed out

dawn gazelle
#

Change the variable type first (perhaps it's on boolean?)

chrome nymph
#

what is the default value of a local float in a macro

wintry gazelle
#

Ohh my variable was a struct. I'm guessing structs can't be sets

chrome nymph
#

is it always 0?

#

is there such a thing as an optional local float in a macro?

#

i guess i could just simulate it with a local boolean

#

works like a charm now - thank you all

zealous moth
#

@wintry gazelle you can make and set or set members in struct

chrome nymph
#

what nodes can i use to conditionally provide a vector?

weak zealot
#

Am i doing something wrong here? My object keeps spasming out once it reaches a certain rotation

chrome nymph
#

do i need to have two MoveTo branches that accept different parameters?

#

is there a better way to do this - cant seem to figure out how to get Flow control to do this

#

ah

#

select vector

tawdry surge
#

@weak zealot depends if you want x and z to be unchanged or set to 0 like you're doing

weak zealot
tawdry surge
#

Oh you're pry hitting gimbal lock

dawn gazelle
weak zealot
#

I'm only rotating around the y axis

weak zealot
chrome nymph
#

i set it to select if not null - but the debugger complains im trying to access a null value

#

or does select demand the data eagerly

dawn gazelle
#

Selects still try to grab the appropriate values.

chrome nymph
#

ahh

#

i thought it was lazy

#

is there a Lazy Select node equivalent?

tawdry surge
#

Yeah that's gimble lock. it has to do with how it calculates the rotation. I'm blanking on how to fix it without a quaternion

chrome nymph
#

like a switch / pattern matching operation

dawn gazelle
chrome nymph
#

would have to end up with two MoveTo operations heh

#

oh well

#

thanks!

weak zealot
chrome nymph
#

btw is there an easy way to duplicate a node in bp editor

#

like alt left click drag in viewport

haughty temple
#

Control w with node selected

chrome nymph
#

hmm maybe only on windows

#

mac doesnt work for that

haughty temple
#

Ahh yea not sure about mac can mac control c then control v

chrome nymph
#

yea

#

i should probably just switch to windows for UE

frozen ledge
#

๐Ÿ˜ฆ bruh moment

chrome nymph
#

seems to be far better supportedf

frozen ledge
#

i'm casting a player character which is taken in as a parameter and yet it's not recognizing it as one lol

haughty temple
#

The execution pin needs used

tawdry surge
#

#ue4 #beginner #blueprint #rotation #flight
Quick and easy fix to overcome gimbal lock for any game requiring the full 6 degrees of freedom!
Everything in this tutorial can be accomplished with no knowledge of c++. The code used to create the custom functions can be found below:

https://pastebin.com/DqBgCUkx

โ–ถ Play video
frozen ledge
haughty temple
#

Or convert to pure cast with right click if you know itll validate

frozen ledge
#

i should really experiment before asking lol

#

i always figure it out after i ask the question lmao

#

like literally the second after

haughty temple
#

XD

chrome nymph
#

oh wow you can control the branch of nodes by clicking along its node

#

... my ocd is satisfied

#

there has to be a better way right... some sort of tool to auto-format blueprints?

haughty temple
#

They have plugins like electric nodes or whatever but reroute nodes works just more work can highlight 2 nodes and align them as well so wire is straight

true valve
#

I have a 5mb csv file loaded into a data-table. Instead of showing all in a single scrolbox, I want to use pagination.

chrome nymph
#

btw - how does the Ai Move To command work?

#

why does it not need to be ticked on?

#

how can i create functions that can tap into Event Tick, but without having to explicitly connect to it?

#

timers arent ideal for movement because it gets affected by varying tick rate, so what's a better alternative?

#

and is there a way to make an optional parameter e.g. vector in a blueprint?

tawdry surge
#

Why would you want it separate from tick? If the frame rate drops and movement doesn't then the lag will be more noticeable

chrome nymph
#

without having to connect Event Tick

#

e.g.

#

i have to do this

#

instead of saying - please move to location X. go hook up to a event tick urself

#

AI Move To has this ability

#

it simply accepts a callback then hooks into event tick itself

#

its a lot more ergonomic to use than having to create event ticks everywhere

#

basically - i wanna create my own MoveTo function with the ergonomics of AI Move To

tawdry surge
#

Ok, I don't know if you can do that in BP
BP functions don't really handle time logic

#

You can't just use the ai node?

chrome nymph
#

i think ai nodes need to have movement component?

tawdry surge
#

Nah has to have an ai controller tho

chrome nymph
#

ah so i guess they probably use the controller to handle that logic

#

and their controller hooks into event tick then

tawdry surge
#

Probably since inputs are on tick

tawdry surge
#

Idk, never tried..
Not too much is impossible tho

#

Might be more work than it's worth tho

chrome nymph
#

strange. thought these would be really fundamental ergonomic nodes

#

is optional not really a thing in c++?

tawdry surge
#

I mean they gave you tick as an option..
You could probably dig into it and figure something out, but I'm not really sure why bother.
Not like it'll save performance or be any faster

chrome nymph
#

hmm

elder ruin
#

I'm working on a new project after some time away from using Unreal, so hoping someone can give me a little nudge in the right direction. I'm working on a project where my Twitch chat can have a little character that will take part in the game (think like a meeple in terms of complexity). The character will have about 5 unique variables bound to it. Think it'd be best to use a pawn for this? Or make a master BP with something else and just create children off it?

#

Actually now that I've said that out loud I should just make an actor and not be dense.

chrome nymph
#

why does SpawnActor not respect the scale of my actor's component?

#

it seems to set the scale to 1 instead of keep it at 0.25

brazen pike
chrome nymph
brazen pike
#

Just set the transform settings to be as you want

chrome nymph
elder ruin
chrome nymph
#

nvm i think the solution was to create another scene

#

and make the sphere a child of the scene rather than the root

chrome nymph
#

is there a node that allows me to change a float from
0...1 -> 1...0 alternating - but accepts an ever increasing value e.g. tick seconds.

#

or do i need to manually create a function for this

#

e.g
0.5 = 0.5, 1.5 = 0.5, 1.3 = 0.7

#

oh

#

timeline

lofty ravine
#

hey anyone know how i can trigger a combo-box on ue4 to play audio would be a big help

dawn gazelle
lofty ravine
#

yeah like depending on the selected option it plays a different song

sweet terrace
#

Is there a way to prevent a pawn pushing another pawn without turning off collision?

dawn gazelle
lofty ravine
dawn gazelle
lofty ravine
#

ahhh ok thanks!

lofty ravine
#

nvm i got the issue thanks for the help i met a deadline thank you so much

raven hollow
native linden
#

hey so, i need to have a list where each item on the list casts an event when selected, and i need to scroll through them one at a time. how would i do that?

maiden wadi
# tawdry surge <@!143471961723371520>Don't tags just maintain a data table and check against it...

Tags are just a comparison data type. Same as an FName or Integer or Strings. It's no different than older games using Integers or Strings. If you've messed around cheating older games, you often spawn items by their integer ID. It just looks that item's data up using that key. So if that's what you mean by that, then yean. GameplayTags just have the benefit of both being an integer, and named, and tiered. In the end it doesn't matter what you're using for a key. If you're not organizing your game items into tables or data assets against a lookup key in some way, you're going to have a really bad time managing them, and specially creating UI for them.

remote obsidian
#

Hi all, is there a way to apply material changes on a staticMeshActor back to the StaticMesh Asset in editor?

maiden wadi
#

Probably some form of editor widget could do it.

remote obsidian
maiden wadi
#

No idea. I don't normally do editor level stuff.

thorny rover
#

Hi! Does anyone know how to make parent class blueprint receive overlap events that happen with its child blueprint components?
i have houses with various sizes / shapes, doors in random places so i made them a parent class (from static mesh actor) that has no components in order to classify them all as houses (initially for another reason). But now i need to check if my pawn enters the house. But the overlap events do not reach the parent blueprint because it has no components to overlap. I enabled overlap events but nothing happens because it only has an empty static mesh component.

I think opening up every child blueprint and getting overlap events to trigger there is kind of stupid / repetitive last way option (i have bunch of houses), maybe there is a better way to access from the parent? I can access child actor components in beginplay and display their names (image) but i can not track their component overlap events..
Any ideas?

remote obsidian
#

I've found a fiddly but usable method, with printing out the replaced material name alongside the default mesh material slot name

mild crystal
#

How can i move a actor to a location? and doing a animation while not there

mental trellis
#

That's probably what you'll have to do, yes.

earnest flax
#

hey guys, could I ask how do I make a static mesh from actor rotate forever (like helicopter blades for example)? Thanks for help

timber knoll
#

current would be current actor location, set the actor location to the return value of the interp

mild crystal
#

thx

#

i made this but i wanna move a actor when its true.

#

but idk how

timber knoll
#

then you can implement it in your child blueprints however you like

timber knoll
# mild crystal

First of all, why would you want to move a characters mesh?

#

that's going to break all the collision etc

#

Instead of the branch, just save the value as a boolean and branch on event tick with what I've shown above

mild crystal
#

doing that

timber knoll
#

These docs are most likely just decals btw, disabling depth test only works for translucent for obvious reasons (solid objects always render closest)

mild crystal
#

like this

#

?

idle pelican
timber knoll
# mild crystal

yes and that way you know when to move the character in your event tick

mild crystal
#

and now how do i move to a location?

#

my character*

#

how do i move a character to a location?

chrome nymph
native linden
#

how do i get my current controlled pawns transform as a variable?

odd ember
#

get controlled pawn > get actor transform?

native linden
#

ah

#

thanks :)

#

and then plugging that in to "set" will set it when the set is run?

knotty bane
#

@native linden what do you mean with "set"? use SetActorTransform node for that. There is also Get|SetActorLocation if it's the only thing you'd like to change

#

has your pawn a movementComponent attached? then you would do this differently

native linden
#

it works :)

cosmic loom
#

Hello, I have a problem, I previously made a Character Customization Screen, it changes the skeletal mesh it works completely fine, but when I click play (Which redirects to loading a level), the character class has the default skeletal mesh

crude eagle
#

Hey quick question. I have a Editor Utility Widget that I would like to call some function on. But I would like to call them from a plain UObject to keep my architecture clean. I cannot do that because when the function is declared in a Editor Utility Widget it is then automatically EFunctionFlags FUNC_EditorOnly. Any way to get rid of this flag on a UFUNCTION? Or to make the UObject also be editor only?

magic parcel
#

Ohla!!!

#

I have seen a few tutorials on "chest opening", but in the interest of not creating the same problem as I did last time I came here... i tried to do it on my own ๐Ÿ˜›

#

interestingly.... I got some results!

#

Also, interestingly, I have some results that do not make sense

#

I have a BP, that has a collision box, when you enter the box is sets "isUsable" to true (bool)

#

on end over overlap, it sets the bool to false

#

I have a print string to show that either of those events are happening, and they are

#

what is wrong with the top part....

#

its not firing either string

maiden wadi
#

@magic parcelYou've never enabled Input.

magic parcel
#

@maiden wadi , how would I do that?

maiden wadi
#

You call it on the player's local controller.

magic parcel
#

call, enable input ?

#

hm..

maiden wadi
#

Yeah. And pass the local controller in.

magic parcel
#

before, or after the branch?

maiden wadi
#

Before you ever press E

#

E will not run without input enabled.

magic parcel
#

interesting

#

it his because its not on the player controller?

#

(first time doing something like this)

tawdry surge
#

Because actors shouldn't take input

magic parcel
#

ah

#

so my thought was to make this on a "chest" type of BP

tawdry surge
#

Pawn or character can by default

magic parcel
#

so that any object i put before/below would work with it

#

is that a wrong method?

tawdry surge
#

Use an interaction interface and have that tell the chest to open

magic parcel
#

hm...

#

so the main "coder" of the project does that (i am the artist learning to code)

tawdry surge
#

Look up blueprint interface

magic parcel
#

but i didnt see how I would hook into that

#

he has the inferface created and uses it for weapon pickup

maiden wadi
#

Actors can take input. It's actually how the system was designed to be used.

magic parcel
mental trellis
#

Basically the button press will only work when there's something controlling it. You don't control the box. So you have to interact with the box external from the thing you do control.

maiden wadi
#

But in this particular case, traces and an interface are much better.

magic parcel
#

@mental trellis makes sense

#

so I should try to use this off of the event interact?

maiden wadi
#

A good example is players weapons. It's much cleaner to add ownership to the weapon and enable input in it, and put the fire event in the weapon then go passing shit through multiple classes just to call fire.

mental trellis
#

Yeah. You want to add an interface Interactable or Useable. Implement it on the box. Then on your player controller or pawn/character, add a "use" or "interact" trigger, which does a ray trace out from the camera (or wherever appropriate.) If it hits something, check if it's "usable" or "interactable" and then call the "use" or "interact" method.

magic parcel
#

hm...

#

okay, I will have a go at it

#

i want to avoid trace

#

i hate when I am in PUBG or other games where I need to look at the object

#

instead of being able to focus on the area in front of me. So, that is why I am going with overlap

#

so i can keep looking at the area I need to focus, but still pick up the object if I desire to

mental trellis
#

Check the way Dying Light 2 does it.

tawdry surge
#

You can sphere trace around the character so it doesn't matter which way your looking

magic parcel
#

@tawdry surge i saw that method too

mental trellis
#

It basically checks every item on screen within grabbing distance and interacts with the one closest to the centre.

magic parcel
#

which is interesting

#

but then how do you pick up the item you want if there are 50 of them ๐Ÿ˜›

tawdry surge
#

Multi trace and a for loop

magic parcel
#

@mental trellis that is intersting

#

so, if I understand this correctly

mental trellis
#

Fucking hell my typing is terrible today.

magic parcel
#

i call the event Interact

#

to the branch

#

then from the branch to whatever I need done

#

in the interact, i put the bind for the button input (e) in this case

mental trellis
#

I would do a sphere multitrace based on your camera's location, check what's got the smallest angle to your camera's view rotation and interact with that.

magic parcel
#

btw, seriously, i appreciate your help on this. All of you. So inviting and welcoming! makes me want to learn more code ๐Ÿ˜›

vagrant flicker
#

Heya. Is there any way of just detaching an item from hand and leaving item to drop on the floor using physics? I am casting line trace to find the floor now and detaching the object if floor is founded but it's ugly and item is teleporting on ground :D

mental trellis
#

(and avoid angles over, say, 60 degrees)

vagrant flicker
#

I thought there would be an easier way of just releasing the object

mental trellis
#

Moonrider: spawn another actor and move the component to it

vagrant flicker
#

But I'll have 2 actors that way

tawdry surge
#

@vagrant flicker If you enable physics on the item it'll just fall

icy dragon
magic parcel
#

just enable physics, easiest way ๐Ÿ˜›

mental trellis
#

@vagrant flicker Actors tend to represent a single unit, a person, an object, an idea (oh the imagination!)

magic parcel
#

and set character NOT to collide

#

cause if you enable physics and the character and it overlap, its going to fly

#

or make your character fly

#

lol... that is always fun when that happens

icy dragon
mental trellis
#

Well, technically, you can add a component without an actor. It will just crash the engine in most cases ๐Ÿ˜„

icy dragon
#

Actors are inherited from UObject, and the latter can't be placed on the map/level.

vagrant flicker
#

Thanks guys, I'll give it a shot

magic parcel
#

so, before I go fucking up my entire player controller

#

should this trace be done on the player controller?

#

correct?

#

that is what it sounded like

mental trellis
#

Yeah.

magic parcel
#

k, here we go! (cue mario sound)

tawdry surge
#

I usually do it from the character since it's what I want as the starting point

keen hedge
#

Hi, I have two actors, one is added to the other via child actor component and it's root component is a static mesh. Now, I'm setting the mesh for the child actor's static mesh component via the construction script of the parent actor. And I can see the mesh in the editor just fine, but in the viewport of the parent actor there's no child actor mesh visible... Is there a way to see stuff in the viewport that's set/added/spawned via construction script?

tawdry surge
#

Controller may or may not be at the pawn location

magic parcel
#

so not the controller, but the player character ?

mental trellis
#

@keen hedge a drawback of the child actor components is that the actual child actor isn't available in construction scripts of the parent

#

@magic parcel it's up to you, either is good, depends on your code.

tawdry surge
#

Just do it wherever the weapon interface is at so you can piggy back off that

magic parcel
#

k

#

thanks ๐Ÿ™‚

#

ill give it a go and see how it works

#

I got cars to work last night, so.... why couldnt I get this work tonight ๐Ÿ™‚

tawdry surge
#

This is easier than physics for sure

hexed cloak
#

How do I get the value after the decimal on a float? 13.25, how would I get just the .25?

icy dragon
tawdry surge
#

Modulo

#

Or wrap

thorny rover
tawdry surge
#

Actor overlap doesn't work

#

Should fire if any child component is overlapped as well

hexed cloak
#

My little analog clock works now lol

thorny rover
chilly geyser
#

Nevermind got it

thorny rover
# tawdry surge Should fire if any child component is overlapped as well

OnActorBeginOverlap (StaticMeshComponent) inside the parent, created a simple print function and nothing happens. In beginplay everything prints and i can access child components from specific child. Generate overlap events is turned on, and collison is overlapall, StaticMesh is empty, since children inherit it anyway

tawdry surge
#

No. Not the component one. The default on actor begin overlap. For the whole actor

thorny rover
sterile moss
#

Hello everyone, quick question, does anyone know of an alternative to Pawn sensing for a player looking at a pawn?

left token
#

Hi, I'm implementing a video playback system in a widget, so far I get everything working as I like.
The only issue is that the media texture is not initialized when I construct the widget for the first time. I set the image size by getting the resolution of media texture.
After the initial launching of the widget, the texture size is set properly as it can now read the media texture properties.
How can I initialize the media texture before the widget asks for the resolution?

thorny rover
tawdry surge
#

It should. That's odd

thorny rover
#

thanks!

mild crystal
#

so i made this, and now on true i want to move the character to a location. How do i do that?

chilly geyser
#

does anyone know how this node works?

odd ember
chilly geyser
odd ember
chilly geyser
#

I cant seem to get it to work

#

I actually have that set to any tags match

chilly geyser
odd ember
chilly geyser
odd ember
#

are they spawned at at the time you are making the query?

chilly geyser
#

they are spawned before

#

pretty sure

odd ember
#

I mean the dropdown doesn't mean that you can't pick a type that doesn't have the tag

chilly geyser
odd ember
chilly geyser
chilly geyser
chilly geyser
pastel rivet
#

Is there any method to get a custom events name?

#

In BP

odd ember
fierce stump
#

This is gonna take a fair bit to work out

#

Ideally I want the HUD widget removed when the player hits 0 health, and then have the Game Over Widget replace it

chilly geyser
sharp rapids
fierce stump
#

Figured it out, forgot to make it valid as well

zealous moth
#

If a UFunction is set to blueprint callable, can it still be called through c++?

tawdry surge
#

Yes

zealous moth
#

hm odd, someone reported it couldn't be, thank you

fervent temple
#

is that inefficient

tawdry surge
#

You can't reference anything from BP in C++.

fervent temple
#

the node mana regen is done in cpp

weak zealot
#

How can i view my objects rotational gimble? I'm trying to get around gimble lock

fervent temple
#

in my project i use helper classes just for bp functions that are slow

tawdry surge
#

^

zealous moth
zealous moth
icy dragon
fervent temple
#

thats the way id do it. cuz pure c++ is just a waste. BPs are really good for ez stuff. unreal is cool cuz a good workflow involves using both

fervent temple
zealous moth
#

ok, what about a plugin in c++? that should be referenceable in c++ no?

icy dragon
#

pure C++ is just a waste

fervent temple
icy dragon
zealous moth
#

you mean C++ ^?

fervent temple
#

yeah he meansthat

zealous moth
#

but yeah i get it

icy dragon
zealous moth
#

oh no!

fervent temple
#

C++ to C++ u have to make the class u want to reference public. its good practice to only create one way dependencies

zealous moth
#

oh... maybe i didn't make it public

#
    UFUNCTION(BlueprintCallable, Category = "AAA")
        void ToggleTraceCheck(bool CanTraceInput);```
#

since i didn't say public, it's inherently private, right?

#

oh wow i am in the wrong channel... my bad

runic phoenix
#

Hello blueprinters, I'd like to create a system where players can send bug reports in-game. Ideally, I'd send a bunch of data and their feedback to a google sheets document. Any ideas how I would go about doing this?

icy dragon
muted ember
#

Hello, I would like to make a battle pass system but I don't really know how to go about it. In particular, I want to give people the possibility to see the time remaining before the end of the season in real time (like on Brawl Stars)

torpid hound
# fervent temple is that inefficient

Lose the tick. Trigger the delay on BeginPlay and then loop the Set back into the delay. That way you're only running blueprints when you need, rather than every tick

icy dragon
muted ember
#

?

high sapphire
#

I'm working on a saving/loading system in Blueprints, I've got it properly saving/loading player xyz and the level the player is on. However, I can't seem to get it to properly save/load the camera's rotation.
Bottom is the camera's rotation when I save, top is the camera's rotation when I load that save.

icy dragon
high sapphire
#

Would that be off of the character, or off of the camera manager?
Looks like I found it, but just to confirm - Get Player Character, Cast to, Get Control Rotation?

tawdry surge
#

I don't think you have to cast for that

high sapphire
#

Hm.. Looks like it's still not working on my end. Maybe I'm doing it wrong?

#

Here's how I have it set up for saving

#

And for loading

odd ember
main lake
vital aspen
#

Has anyone here worked with datatables. I need to loop threw all records. and return only the ones that have recipes. and then display the Name and Icon for that recipe.

#

it's just I'm using 2 for each loops and I want to do this with just 1 loop

odd ember
#

how would you expect to do it with 1 loop?

#

you have two separate arrays

vital aspen
#

just 1 array for the recipes. and I' using the data table to get the records for each item

#

that has a recipe.

odd ember
#

the array of records is also an array

#

so you have: array of records > array of recipes

#

so you need two loops for that

vital aspen
#

Ok, this is how I start it

odd ember
#

yep

#

looks correct

vital aspen
#

ok, this is the 2nd loop and ends the 2nd loop, I think

odd ember
#

so there's another data table?

vital aspen
#

The node I have selected is erroring out

#

no, just 1

odd ember
#

which would imply a different data table

#

which is probably why you're getting an error?

vital aspen
#

Ok, After the 1 loops it gets all the records 1 at the time. Then this happens

#

This checks to see if it has recipes, If Yes. then it starts another loop to get the recipes and then displays the results. Your saying some thing it wrong here

#

This part loops threw the recipes.

high sapphire
vital aspen
#

My ideas don't seem to work, can you tell me how to fix this @odd ember

odd ember
#

I don't know what error you're getting

vital aspen
#

ok, Thanks for what help you can give,

odd ember
#

all I can tell you is what I see

vital aspen
#

ok, Can anyone else help.

high sapphire
#

Hmm, even trying this isn't seeming to work. Not sure what I'm doing wrong..

#

It's still going back to the same default rotation

#

Oh, there we go, that worked. Just had to handle it in the Level Blueprint instead.

rich prairie
#

I just downloaded 4.27.2 through the Launcher.

I wanted to use Chaos.

Was that a mistake? Am I required to download and install from GIT?

severe tendon
#

How could i make a crosshair that moves with the mouse?

#

Like in top down shooters where you move the crosshair in the screen and shoot from there

rich prairie
icy dragon
blissful grail
rich prairie
#

I'm not really looking for anything special

icy dragon
rich prairie
#

Thanks. I see it now. Stupid me, wasted time on downloading, installing and verify of version without it.

icy dragon
rich prairie
severe tendon
#

Where is the option?

#

Inside Project settings

icy dragon
#

Chaos in UE4 is not in a stable state and far more complicated to setup (and not having good performance compared to PhysX)

rich prairie
#

Well, I got 4.27.2 now. So it's not complete loss ๐Ÿ˜„ I had 4.26.2 before.

icy dragon
#

That's what even AAA games do.

rich prairie
#

Okay, so it's actually the right way I use, that I swap it for a destructible.,

icy dragon
#

And from my testings, PhysX destruction isn't like destroying the mesh all at once, so I don't think the swapping is necessary for larger meshes like buildings

It is an option for smaller objects tho.

rich prairie
#

I have actors that only thrown objects should destroy. That's why I was doing the swap mesh with destructible mesh on hit by throw actor

lofty ravine
#

Is there a way i can add mod support to my game and add custom assets???

icy dragon
icy dragon
lofty ravine
keen wedge
#

Hey all, I was wondering how you all tackle the order of execution when it comes to bindings...

I often have a function off of BeginPlay which sets up some refences to classes I will need to use a lot, if it was the GameMode I may have the PlayerController referenced for etc. In addition to this, I'd have a following function which does the bindings for events.

The problem I run into, time and time again, is the order in which objects are created, and depending how you launch the game, viewport, standalone, build, it varies.

What I would really like is a process that I can use which says "all the important stuff is setup, its safe to do the bindings now" (or any other initialisation that I want to do that relies on various things being set up. Of course, if I use the GameInstance, I can't connect to some of these objects with a bind because they won't exist at the very begining. So my problem is effectively handling late binds.

One method that seems to work - WHICH I HATE - is throwing in a Delay node for 0.2 seconds... invariably everything seems to be created by the time thats happened, and then it all just magically works, but I HATE this so much, as its just a bit of an artbitrary value that whilst it may work on my laptop, might not work for someone else's set up...

So... what is it that I'm doing wrong? Is it my approach? Is there a better way? I tend to use the event driven route via dispatchers quite a bit, so would really like to find a good way to just make this work every time... I'm learning towards the GameInstance effectively waiting until everything reports that its setup... there's a HasBegunPlay node which looks like it might support this, but I would really like to know what you all do...

late gorge
#

Hi, i want to be able to invert a N-dimensional matrix (and just access N-dimensional matrix math) but i'm only seeing 4D matrix operations in blueprints. Are there ways to get N-dimensional matrix math? Or is this only available in c++/not at all?

muted ember
rose citrus
#

HELP. I deleted a macrolibrary I didn't need anymore and a few minutes later I played my game and i got an error. Now I see that for some reason my character movement in my player and enemies are gone!!

#

What do I do?

#

It doesn't seem like I can just add character movement component back

crisp vault
#

is there a node which ignores/doesnt have the opacity of the color and opacity node?

tranquil abyss
#

@maiden wadi so I think my issues is more to do with the logic in the Widget (first picture is the Color logic for the widget and the second one is getting the text for the widget. Seems to be returning to all of that class and im wondering how I can get the value for the individual actor and not show for everything of that class. When I stand over one item and then another it will only show the name and color for the first item (if im over multiple) Interesting stuff

#

ik ur answering like 40 questions atm lol sorry

odd ember
#

e.g. if one actor spawns another actor, you can assert that the parent will spawn before the child

tranquil abyss
odd ember
#

so every frame you'd have to check

tranquil abyss
#

oof

odd ember
#

if you just check once it's useless

tranquil abyss
#

I tried

odd ember
#

polling is valid

#

but there are better ways

#

for the most part

tranquil abyss
#

@odd ember if you have a second could you take a stab at my recent question also

odd ember
maiden wadi
# keen wedge Hey all, I was wondering how you all tackle the order of execution when it comes...

This can get tedious after a while. The problem with answering this question is that it depends on a case to case basis. Most of it just comes from knowing the framework and how you build your own on top of it. If you want a truly easy way to handle manager classes amond each other at initial beginplay, use casts and a registration system somewhere like your GameInstance or a base GameState class. Have objects fire off and send themselves to the system when they're ready for play as a base uobject pointer. Your objects that need bindings can bind to these classes. GameIntance always exists, and GameState has to exist for Beginplay to be called so they're always available for binding. So if your classes that need to bind to other major things register with this, and then call their own check to see if what they need exists, if no, they wait for the binding to run, cast each object to the pointer type they need, if it's the correct one, it is the object you're looking for. This of course only works with framework classes, won't work with things that there can be multiples of. But usually those things are wrapped in their own managers anyhow. But like I said, there is no one solution for all. Stack your bricks and try to keep them somewhat in order as you do.

rose citrus
#

I seem to have a problem. I deleted a macroLibrary I didn't need and I realized a few minutes later it somehow deleted my character movement components in my player and enemy blueprints. I don't know how that is possible but now I don't know what to do. I don't seem to have a recent backup of those blueprint. Is my only option to copy and paste all the nodes, variables, functions, macros etc to a new player blueprint?

mild crystal
#

so i made this, and now on true i want to move the character to a location. How do i do that?

odd ember
mild crystal
maiden wadi
#

Also. Your first two image's cast nodes are bugging me. ๐Ÿ˜„ You're calling actor level functions off of a cast that will always succeed. Makes the casts pointless.

maiden wadi
tranquil abyss
#

well Id like to post an explanation

#

with pictures but this is happening again

maiden wadi
#

Clyde doesn't seem to like you. ๐Ÿ˜„

tranquil abyss
#

ik lmao

#

1 sec

crisp vault
#

i found also render opacity which the node doesnt set so could use this, the problem is always not to know which way is best, since UE loves to crash so much, thanks

maiden wadi
#

Depends on your case. Render Opacity is probably easier for most widgets. Color only works on stuff like Borders, Images, Text, etc.

crisp vault
#

Okay then ill use this instead for now, thanks for the advice

mild crystal
#

i made this function but isnt working, can someone help me?

tranquil abyss
#

and then if I walk away from both and go to the second

#

the second weapon displays properly

maiden wadi
#

Are these all in the weapon?

tranquil abyss
#

and this creates a problem with Im holding a weapon. All the weapons I walk over have the weapon im holdings name and color

#

Yes

#

My coworker just said I should be getting these values form the local weapon stuct its self and not a database look up

maiden wadi
#

Then you need to ditch the idea of getting it from the character. Your weapon knows what it is itself. The only thing it should need to know about the character is whether or not the character is overlapping it.

#

Database lookup is fine. But your weapon class would need it's own FName set for that weapon type to look up in.

tranquil abyss
#

I love over engineering the hell out of things

maiden wadi
tranquil abyss
#

That is in the widget btw

#

not the weapon

maiden wadi
#

The widget is in the widget component?

tranquil abyss
#

the Get text and also get color are part of the widget

maiden wadi
#

Weapon's beginplay needs to pass the weapon's self pointer to the widget. GetWidgetComponent->GetUserWidgetObject->CastToWidgetClass-> InitializeWithWeapon(Self)

tranquil abyss
#

sorry work picked up so I might be confusing

brazen pike
#

rather than a switch

tranquil abyss
#

oof

maiden wadi
#

Shouldn't do either. Maps are king.

tranquil abyss
tulip mason
#

No, you should do a for loop that checks if each one is true, then do a switch statement. You know, just because.

maiden wadi
#

Personally I'd probably have a data asset with those colors as a map. No need to store that as extra data on the weapon itself. DataAsset can just have a function on it. GetRarityColor(RarityValue)

tulip mason
#

Be all Yandere style

trim matrix
#

Is it bad if an Actor calls Destroy on itself?

maiden wadi
#

DataAsset can be stored as a pointer on the weapon. Much cheaper than a bunch of colors.

rose citrus
#

Does anyone know what I can do. My unreal engine 4.27 keeps crashing now every time I click on maps and modes in Project settings. As soon as I click the button. I've tried several times.

#

Don't know if this is the right place to post this

keen wedge
# maiden wadi This can get tedious after a while. The problem with answering this question is ...

Hi Authaer, not sure if you mean tedious answering these kind of questions, or the actual problem - maybe both ๐Ÿ™‚

Thank you for the reply. I was trying to think of a way similar to that which you described. I approached it from a very simplistic fashion initially just to see if it might work. 4 booleans on the GameInstance, one for the GameMode, PlayerController, PlayerCharacter, and GameState. The idea was that after BeginPlay on each of these classes they would communicate with the GameInstance to say "I'm ready"... once all of the booleans were True, all of those objects would be effectively ready and I could then potentially use an event dispatcher on the GameInstance to say "Ok, Lets Go!" - each of these would then receive that, and do their initialisation...

...what made it feel icky was that I would have liked to have used the event dispatchers in the other direction also... e.g. have the GameIntance bind to the GameMode's "Instantiated" event dispatcher.. but because there's a good change it won't exist when it tries to do this, it just errors... which means the only other way I can really do it is to expose a function on GameInstance which each of these objects then call... wasn't really how I wanted to do it... would rather those objects just said "I'm ready" and anything that was interested can register its interest so to speak.

Any thoughts on the above, or, in the approach you were suggesting, do you have any form of really simple example you might be able to share?

I go around and around in circles with this stuff, what I would give for a class diagram that visually showed the execution of everything... sniff

odd ember
keen wedge
# odd ember I mean I did give you an example if you look up

Sorry only just jumped back on and missed your replies - my apologies.

The problem with what you've said, in my scenario, is that I don't get to control the spawning of GameInstance, GameMode, PlayerController, or GameState... they are all being created by the engine...

dawn gazelle
# main lake A variable named "Time" and using SetTimerByEvent

If you're using a ratio, then it won't work with the timer code I gave you. What I gave you is expecting to tick on real-time seconds and it determines what the in-game time is based on number of real-time seconds elapsed.
Here's one that works for using a ratio so that the ticks of the timer correlate to your in-game minutes.
https://blueprintue.com/blueprint/oyj161b0/

The calculation for the timer values is based on the the number of real-time seconds / number of game minutes in that time period (so for day time it would be 600 / 1020 (which is 11PM[1380] - 6AM[360])) == 0.588....

All that said, it will eventually fall out of sync with real time if you do it this way as you're dealing with fractions of seconds ticking.

I've tested this code, and it works without issue - as expected, when 10 minutes elapses, it's 11PM, and after another 5 minutes it was back at 6AM. The image here is to show you how to format the Game Minutes Passed into a 24HR time format.

maiden wadi
#

You can generally reliably know that each object is created before another in the case of the default framework. For instance. No beginplay can run without GameState. GameState is spawned by GameMode. GameMode is spawned by the persistent world and that is created long after GameInstance.

main lake
keen wedge
#

and its coming back as null

maiden wadi
#

As for a better example. I'm unsure. I don't have much framework that requires other stuff. Most of my managers are actor components on major actors like HUD for local managers, GameState for game wide managers. I largely ignore the player controller in most cases. PlayerStates are somewhat of a pain in blueprint only, but are easy if you override a C++ function in GameStateBase and add a delegate call. Pawn ui and such is retrieved through their PlayerStates in a lot of cases.

odd ember
maiden wadi
#

Er. I'm not sure that's actually possible. O.o

#

Are you sure a cast or something isn't failing?

keen wedge
# maiden wadi Er. I'm not sure that's actually possible. O.o

I've just checked and it would seem that the cast was failing, because, being an utter numpty, I hadn't specified "my" BP_GameState in the GameMode class defaults... (its been a very long day)...

I'll rewind all of the changes I've just tried and see if I can get it to work... just really wondered if there was a "best approach" kinda thing to this... I fully appreciate that there's so much flexibility with UE4 to make stuff work in all manner of cases, but that very same flexibility seems to cause me no end of problems. Which leads me to feel that I'm a fekking eejit and have no idea what I'm doing... ๐Ÿ˜ฆ

maiden wadi
#

๐Ÿ˜„ Yeah, basically what happens is that GameState has a function that gets called on it by the GameMode. This sets a replicated bool and then calls the function locally. After that two functions are called. The first iterates over every actor currently in the current UWorld and calls Beginplay on it. Then it sets a state in the UWorld that it's BeganPlay. After that any Actor that is spawned, sees that World has beganplay, and calls the event directly after spawning it. Because of this you can always know for sure that GameState exists at beginplay.

dawn gazelle
tranquil abyss
maiden wadi
#

Map in blueprint. TMap in code.

dawn gazelle
pliant jewel
#

Is there a way to use a math function to create a curve in a curve asset?

main lake
spark steppe
#

how tf are you still stuck on this?

#

it's been 2 weeks now?

#

also your ratio calculation looks way too complicated

#

depending on whatever those ratios should represent

spark steppe
#

not sure if there's any builtin method to create a whole curve based on it, but is the curve even necessary if you use a math expression for all values anyways?

dawn gazelle
pliant jewel
spark steppe
#

no, that's something that also bothered me a while back

pliant jewel
#

Ahh bummer

frozen ledge
#

For some reason, on my server TxtLog isn't being called as valid, despite doing a check on both ends

#

i'm doing a two player game, with a function call to print text on both screens depending on whatever was committed in the text field

dark crow
#

Is that in a widget?

frozen ledge
#

yeah, i added this check since i was getting the error accessed none trying to read property txtlog

dark crow
#

Widgets can't be replicated

#

They only exist on Client

frozen ledge
#

oh, interesting

dark crow
#

So you gotta set the text from somewhere else in that case

frozen ledge
#

yeah, I assume I have to dynamically spawn/destroy the text

#

in that case

vagrant flicker
#

For some reason its working only for the one direction ๐Ÿ˜„

odd ember
#

trace a line, get the hit normal, use that?

vagrant flicker
#

I am using the direction now, should I use the hit normal or impact normal?

vagrant flicker
#

Its going underground for some reason :/ It disappears

maiden wadi
#

HitNormal and ImpactNormal are the same thing in a line trace. They only differ in shape traces.

vagrant flicker
#

Using them instead of getting the location makes my detached item disappears for some reason

maiden wadi
#

For the rotation, not the location.

#

MakeRotFromXVector

vagrant flicker
#

Now is one idea better, but the torch is pointing straight up

#

Instead of 25 on X for example

dawn gazelle
vagrant flicker
#

Is there any smart way of doing a check if the item is going to detach against the wall to use that 25 rotation on the X axis, and if its going down on the ground then I dont care

#

for the rotation

main lake
maiden wadi
#

DotProduct HitNormal InRange -0.7 to 0.7

#

DotProduct to VectorUp I mean.

vagrant flicker
#

I am confused

#

I get the impact normal and RotationFromXVector to the transsform rotation of the SetActorTransform

#

Its very close to my end goal, but cannot clamp directly the rotationFromXVector

frozen ledge
#

Not to interrupt, but I can have two separate instances of a widget, can I pass the same value into both of them using an RPC call in blueprint? I'm basically just trying to send a message through both, I already have the implementation, I've turned off the replication on my reference to my blueprint class

dawn gazelle
# main lake I do that in the construction script

Well, if you're sure that's firing, then it's probably because every time the counters tick you're calling StartTimer which resets the timer, which may mess with the counting ....But to be honest, I don't know.

vagrant flicker
#

@maiden wadi do you mean something like this?

maiden wadi
#

No. You need to select between two different rotations. Either the one that is the hit normal, or the one that is slightly offset.

tranquil abyss
vagrant flicker
#

How? Should I use select?

maiden wadi
main lake
#

Authaer could you check the screenshots above please ? ๐Ÿ™‚

tranquil abyss
#

I know what you mean by A pointer in code but not in unreal

maiden wadi
# vagrant flicker How? Should I use select?

That or a function. Getting your rotators is going to be semi difficult depending on what you need. If your torch already stands up straight when it's at 0,0,0 rotation, it's a little easier.

tranquil abyss
#

also can we clone Authaer, to many questions not enough time lmao

vagrant flicker
#

I don't care for the torch if its on ground. It may be rotated however its easier. I need to set the offset if Its touching an object

maiden wadi
#

Is it on it's side or standing up in the static mesh viewer?

vagrant flicker
#

standing in the viewport of the bp

maiden wadi
#

Hmm. You might be able to simply get the RotationXVector from the normal, break it add 25 to pitch and remake it with that and then use that for the rotation.

#

Er. Remove 25 pitch even. Adding would put it the wrong way.

vagrant flicker
#

So get rot from x -> break rot into axes -> X - 25 X -> make rot from X -> plug to new transform rotation

maiden wadi
#

Er. That was roll.

grave apex
#

Im curious, is there any way to make having the blueprint editor open not slow down game fps?

#

even if you have a big graph open?

maiden wadi
#

Run in Standalone.

vagrant flicker
# maiden wadi

This is exactly what I was looking. Just now when I drop the torch on ground it is going slightly underground. Is there any fix for that?

grave apex
maiden wadi
tranquil abyss
maiden wadi
#

Oh, right. Uh. Yes, and no. Now you have to create the actual asset. That's the class for it.

vagrant flicker
maiden wadi
#

You should be able to create a new Asset out of that class you have there. Then in your weapon you can create a pointer of the class type, compile the blueprint, and then set it to the new asset version.

#

You can add properties to the class, and set their defaults in the asset. You can also add functions to the class, and call them on the pointer you specify the asset instance in.

tranquil abyss
#

I already deleted the asset blueprint thing

#

oh

#

So you need to make a bluepritnt of a type of data assets?

#

and then select it for the data asset

maiden wadi
#

Yep.

tranquil abyss
#

My brains gonna pop ๐Ÿ˜‚

maiden wadi
#

๐Ÿ˜„ Welcome to data management 101.

tranquil abyss
#

I gotta say having a CS degree helps alot with this

#

I would have zero clue if I didnt understand how code works

maiden wadi
#

I wish I had one. Would probably help. It takes me some time usually to catch on to specific words or phrases when reading tech blogs and such. ๐Ÿ˜„

tranquil abyss
#

You dont need one at all

#

but it made since for me to go to school

#

anyways

#

@maiden wadi so make the logic in the blueprint asset and then make the acutall asset form the blueprint

#

progress is happening

#

finally

maiden wadi
#

Yep. You create properties and code in the blueprint, and then you can open and set those defaults in the pink/purple asset version.

tranquil abyss
#

Yeah this make since

#

this is just a python dict

#

and dicts are fast af

#

๐Ÿง 

dawn gazelle
#

Every time the timer ticks, it's going to reset the timer.

main lake
# dawn gazelle

Yeah but the counting timer is my variable "Timer" which keeps the old value before the reset, so I don't see why it's a problem

dawn gazelle
# main lake Yeah but the counting timer is my variable "Timer" which keeps the old value bef...

I'm just pointing out that you have a timer that is intended to loop, but you restart it every time it ticks, thus it's not really looping. There may be something happening where unreal doesn't start the timer again until the next frame, in which case you're potentially not getting enough time actually set into the timer variable as the timer tick is not firing as much as you're expecting it should.. If you just let the timer loop as it's supposed to without restarting it, then unreal can handle the number of time's it's supposed to execute each frame without issue. This is only a guess. I literally have no idea further as to why your timers may be going out of sync, but this looks like something that potentially could cause it.

maiden wadi
# tranquil abyss Yeah this make since

Yeah, map lookup is incredibly fast. And also you get to specify it in one place. Saves memory. ๐Ÿ˜„ Not so bad on small stuff like this, but it all adds up. But now you have a global easy way to access your weapon rarity colors from anywhere you need. Anything from a visual glow affect, or widget can access this data with ease.

tranquil abyss
#

๐Ÿง 

main lake
dawn gazelle
#

Don't call Start Timer on tick of your timers.

astral epoch
#

Is there any sort of Begin Play on Init function/event for pure Object classes?

main lake
astral epoch
#

Or a Constructor to use for them?

maiden wadi
dawn gazelle
maiden wadi
#

IE, if their owner is an actor, have it route it's own beginplay to these objects, or call a function on them from their owner when creating them.

main lake
dawn gazelle
#

Don't call the night function in such a way.

main lake
dawn gazelle
#

Did you even look at the example code I gave oyu?

astral epoch
#

Suppose I could just set all the faction relationships in the level blueprint actually.

main lake
maiden wadi
astral epoch
#

That might be a good shout, though could I not use the Object on GameState too?

#

Is there any real difference in that choice?

dawn gazelle
maiden wadi
#

Sure, you can. And not much. Components are cheap. And you get easy access to beginplay, and tick, and world. Much easier to access things from without C++.

astral epoch
#

Not hugely worried about having to use C++, I'm making a prototype for now but will likely start using C++ if I'm pleased with the final state of the prototype and want to move forward with the project.

#

But yeah, component sounds like it may be a better shout just for that beginplay. Tick not so useful here.

dawn gazelle
tranquil abyss
#

I do have these set up, the data from the blueprint does show in the asset

maiden wadi
#

Then you can use the pointer to access your function you made.

#

They're static, globally accessible. So there's no need to "Spawn" or "Create" an instance to set into the pointer, you can specify it just like you do a mesh or material.

tranquil abyss
maiden wadi
#

You need to use your own assets name. ๐Ÿ˜„

tranquil abyss
#

I think I need a brain break

#

๐Ÿ˜‚ ๐Ÿ˜‚

long whale
#

is there a way to avoid input variable connection spaghetti in Macros?

earnest tangle
#

input variable connection spaghetti..?

trim matrix
long whale
#

when referencing in multiple places

earnest tangle
#

you can just add additional gets :)

odd ember
earnest tangle
#

good thing I have an official Tim Sweeney Get Out Blueprint Hell card

long whale
earnest tangle
#

Ah, yeah it only works on functions

long whale
#

yes

earnest tangle
#

Not much else you can do then than try to arrange the lines so it doesn't get too confusing

#

I've mostly just made functions, I haven't found macros so useful

zealous oasis
#

is there a way to attach a secondary collision component to a character that blocks movements for others?
Preferably one that I can rotate

earnest tangle
#

Sure, just attach another collider to it

#

did you change its collision profile?

#

fairly sure if you set it to physics and block the correct channel it should block then ๐Ÿค”

main lake
wispy fiber
#

If I spawn an actor from a class soft reference of a blueprint, it will crash unless I've previously opened that blueprint in the editor or have an instance of the blueprint already in the level. So it seems like when there's just a class soft reference to something, Unreal will not bother loading it into memory or something, so it doesn't know how to create it. Does anybody know how I can specify a list of blueprints to make sure are loaded into memory when the game/editor start?

spark steppe
#

load asset blocking

#

then cast the result to class

wispy fiber
#

ahhh neat, I'll give that a try

spark steppe
#

which you can use if you don't need the result at the current tick

wispy fiber
#

sounds good, thanks!

spark steppe
#

@wispy fiber just checked and for classes there seems to be a separate node

#

load class asset blocking (which also does the cast for you)

wispy fiber
#

it doesn't seem to do the cast, but it does work

spark steppe
#

ok, i'm on 5.0 maybe that changed there

wispy fiber
#

ah, I'm on 4.26

#

hmm I wonder what happens when you load an asset on the client and then pass the resolved class reference to the server via replicated rpc and try to spawn the asset

#

probably bad things

spark steppe
#

no idea, also not sure if it's advised to replicate class/object references at all

wispy fiber
#

yeah that's probably a good point too. I know object references are supposed to work, but class reference seems weird (although it does appear to work)

spark steppe
#

now i wonder why the async asset loading methods wont show up in my editor -.- nvm they only work in event graph

wispy fiber
#

if I load an asset on the server and then spawn it (assuming it's a replicated actor), I wonder if the client will automatically load it aswell or if it'll crash

dawn gazelle