#blueprint

402296 messages Β· Page 753 of 403

crimson saffron
#

so I can only move while on certain states

odd ember
#

I think you're running into the reason FName was created

crimson saffron
#

whats that

maiden wadi
#

Or even GameplayTags, which are just nested FNames mostly.

vagrant torrent
#

Hi guys! Help me with the question. I'm making a game where the character is controlled with the WASD buttons (moving forward, backward, sideways). But I need my character to turn in the right direction regarding how the input is being used. I mean to be able to rotate the character with the mouse inputs.

As far as I understand, do I need to somehow convert float values to rotate?

Can anyone visually show how it should look?

gentle urchin
#

Sounds like regular add pitch add yaw, using control rotation?

maiden wadi
#

If you mean the moving the mouse left/right will rotate the character left/right, then definitely just do AddYawInput. If you mean to have the character look at the cursor, I'd recommend doing a mouse projection with some math via LinePlaneIntersection functions.

vagrant torrent
#

I tried to do it through the cursor trace. It works, but there are nuances. It is necessary to fix a lot of elements of the environment. I wanted to make such a logic that the character looks in the direction that is relative to him to the cursor (but without the cursor), which means through the mouse inputs.

paper galleon
#

So regular add yaw input?

vagrant torrent
#

That's how I have a rotate right now. And I want to replace it with mouse inputs.
But how to do it (due to the fact that I am a beginner in the engine), I don’t know how to do it.

brittle plinth
#

I want to attach a cable to a skeletal mesh and after an event, the skelatal mesh will be destroyed and i want the cable to have attach start unticked
how do i set that up in blueprint ?

paper galleon
brittle plinth
#

and the cable component ?

#

where does it go ?

paper galleon
# brittle plinth and the cable component ?

Sorry, I had to take off for a while. Are you in a cable component blueprint? Unless it has custom code, you don't need to subclass it.
Alternatively did you just create that variable?

brittle plinth
#

so I have 4 cables in the level

#

they are not in a blueprint

paper galleon
#

Oh this is level blueprint. Drag off the cable component and search for AttachStart. Choose the SetAttachStart and make it false

brittle plinth
#

just normal components in world

#

soo

paper galleon
brittle plinth
#

I did it guys

#

THank you so much!!!

obsidian folio
#

This variable gets set off the begin play, and I can see that it was set, yet when this function gets called, in the Message Log it says that it got None when it tried to read the property for the variable. Everything in the editor runs just fine, but I want to clear this error.

odd ember
#

probably something with it not replicating correctly? perhaps try over at #multiplayer

obsidian folio
#

It doesn't need to be multiplayer though as this is going to be a UI function

odd ember
#

have you checked that it's not a replication issue though?

obsidian folio
#

I've changed the custom event to no replication as well and same result

odd ember
#

right but I mean when it's being read by the game

dawn gazelle
#

What actor is the In Game WRef being set?

obsidian folio
#

It's the player character actor

dawn gazelle
#

Can you show the code you're using to set it?

obsidian folio
#

Essentially this is just sending a message to show up on the screen, fancier than using print string lol

dawn gazelle
#

What comes before that?

obsidian folio
#

Hooked into a sequence off the begin play

dawn gazelle
#

What is the object that is being plugged into the cast?

obsidian folio
#

oh sorry

dawn gazelle
#

So that cast is failing

#

OR

#

You don't have In game WRef set in your BP Jig Character

obsidian folio
#

I ran a isvalid? check after it was set and print string and it set correctly.

odd ember
#

double check via breakpoints

obsidian folio
#

What you mean by break points?

dawn gazelle
#

With a node selected press F9 - it'll mark the node so that when executing it'll pause at that point. Allowing you to inspect variable values by hovering over pins and validating the logic.

#

F9 again with the node selected to remove it once you're done testing

obsidian folio
#

Oh WOW!

#

I have never used that before!

#

Yeah everything is showing as set.

dawn gazelle
#

What is W Game Wref? Is it a widget? And are you playing as client?

obsidian folio
#

It is a widget, I was playing in Standalone but switched to client, and still same issue.

#

The widget is initially set in the character, the component that is attached to the character casts to the character to get a quick reference and then calls for the widget so it can set a direct reference to the widget as well inside the component.

#

This way the component can use the widget reference to call the function that will send notification messages to the player

dawn gazelle
#

So widgets won't exist on server, so that's part of the issue.
If you're creating the widget on begin play and then also trying to get the reference to the widget on begin play in your actor component you might be running into an issue here..
Instead you may want to consider just creating the widget reference in the actor component instead and let it bind itself to it.

keen quest
#

Okay so i'm struggling to figure out how a blueprint can read another ones' variable. Does only casting to the object work?
Lets say I want to pick up a key, set that ones variable to true and in the doors blueprint i want to ask for it?

I have set that variable and it works as intended, however when i try to access that variable from another blueprint, its not working?

obsidian folio
#

So, begin play, is that always going to be like a server side thing?

dawn gazelle
#

Begin play fires on server and on any clients that it's relevant to.

#

You can usually use a Has Authority switch, but they don't exist in actor components.

#

What I usually do in that case is check the owner's authority instead.

dawn gazelle
odd ember
#

that's what I meant when I said check if it's being replicated

obsidian folio
#

Oh ok. I'll try swapping it around then.

#

Yeah sorry I thought just switching the custom event from client to not replicated was enough to test that

vale panther
#

Can someone help me and explain why the lines are not white ? , IΒ΄ve been trying to fix this for an hours and nothing seems to work

#

I alredy tried that

vale panther
#

take a look at #animation I posted the result there

dim robin
#

i'm trying to make a minimap using rendertarget. is there any way to isolate only specific objects? i just need to capture my vehicle and the track

trim matrix
#

Hi everyone, how would you make a system of "rising" ? I have a level in which some lava is at the bottom and it need to rise up forever. I thought about using a timeline and a node which set the actor location up until like a billion unit very slowly so that it works during playtime (it's a infinite game that's why I need to make it that long), do you think that would work ?

icy dragon
unborn tusk
#

How can I get sublevels of my persistent level in BP?

late cave
# unborn tusk How can I get sublevels of my persistent level in BP?
trim matrix
vale panther
#

OMG @icy dragon I fixed it 😭

#

thnks for the help

maiden wadi
#

@dim robin There is a list thing on the capture component. This needs to be filled with the actors you want to see and then there's a setting to show only those.

odd ember
#

I've done a similar thing, except it's extending UDevSetting on the cpp side

#

so it's in the project settings

dawn gazelle
#

So if you have something like an infinite runner, or your case, a potentially infinite tower, it actually makes more sense to have your level move rather than the player moving through the level.

wise mantle
#

i made this setup to check whether or not the player is looking at an actor. this works as long as i dont face the opposite direction of the actor. if i face left or right compared to the actor, it knows that im not looking at the actor, but when i face all away from it, it thinks im looking at it for some reason. is this a bug, or do i miss something?

odd ember
#

I don't know your game type

#

but if your camera is first or third person, you can make an easier setup for yourself

wise mantle
#

its first person

odd ember
#

in that case, use the dot product between the camera's forward vector AND the vector difference between the camera's location and the actor's location normalized

#

so something like

#

Dot(camera.Forward, (camera.Location - otherActor.Location).Normalized())

wise mantle
#

hmm

odd ember
#

that's one of the cheapest checks you can make generally

wise mantle
#

ok, ill see if i can figure this out in blueprint, 2 sec

odd ember
#

sure, feel free to paste screenshots if you're in doubt

#

I don't have the editor open right now

wise mantle
#

sure!

#

something like this? how do i normalize this?

odd ember
#

normalize is a function

#

for vectors

#

I'd see if you can use the actual camera, and not camera manager

#

just in case

wise mantle
#

im using the character blueprint, so at the moment im not sure about how else i should get the camera

odd ember
#

isn't there a camera component on the first person character?

wise mantle
#

nope. ive always just gotten it through the camera manager

odd ember
#

huh well alright

#

try with the camera manager then

wise mantle
odd ember
#

alternatively you can probably assume that the character's forward vector is pointing in the way of the camera as well

wise mantle
#

is this the normalize function

odd ember
#

yeah that's the normalize

wise mantle
#

im guessing the dot should be hooked onto the tolerance?

#

what about the vector?

odd ember
#

no no

#

the dot is basically going to give you a value between 1..-1

wise mantle
odd ember
#

1 means that the actor is facing the other actor, 0 means it's to the side of the actor, -1 means it's facing the other way

wise mantle
#

ok, ill test this out

wise mantle
#

i can see the number changing depending on where i look, but its in a lot of digits

odd ember
wise mantle
odd ember
#

maybe less than 0.25 or something, but that's something you can adjust potentially

wise mantle
#

these are the kinda numbers im getting

#

and in minus too

#

ooh wait

#

2 sec

wise mantle
#

when i look at the actor its negative numbers, and when i look away its positive numbers. but this change when i walk past the actor

odd ember
#

did you normalize after the location subtraction?

#

show me

wise mantle
#

sorta the same as before

odd ember
#

you have to normalize

wise mantle
#

i should add a normalize function after the get camera location?

odd ember
#

after you subtract

wise mantle
#

yes

odd ember
#

the two locations

wise mantle
#

before the dot

odd ember
#

yes

wise mantle
#

aah, i got it

wise mantle
# odd ember yes

hmm... how should i explain this. when im on the -y axis and +x axis relative to the actors location, the dot number is positive. and negative on +y and -x axis.

odd ember
#

it shouldnt be based on your axis

#

it should be based on whether you are facing the other actor

wise mantle
#

yea.

#

like this right?

odd ember
#

well right now you are doing it with the plane

mild flare
#

Hi!

This calculation should get an individual player score and add it to their team, it works fine so far but the calculation itself is flawed. if a player has 1 kill, the team has also the value of 1. so if that same player kills another enemy, this means the individual player score (Enemy Kill Point) has the value of 2 and the team already has a value of 1 which then gives the team the value of 3 in total but there are only 2 kills performed. how to avoid this nonsense or what is the prober calc. for that?

wise mantle
odd ember
#

do it with a random actor instead

#

if you are just testing

#

the plane will not give you correct results

#

as it is below the player

wise mantle
#

no, its a plane on the actor

odd ember
#

that wont work at all

dawn gazelle
odd ember
#

it needs to be another actor

#

in world

wise mantle
#

ok so, i have my player, and another actor. the other actor has a plane component on it. thats what im using now

#

and the numbers do correspond to the location of the plane

#

they just change depending on where my player is

odd ember
#

it should be facing direction

#

I don't know where that plane is

#

but judging by your setup it seems to be sharing local space with your player

wise mantle
#

the blueprint is on the plane actor. i reference the player from the plane actor

#

so the plane and the player are not related

mild flare
# dawn gazelle Just add 1 instead of the existing enemy kill point?

hi!
if it comes down to just adding +1 for a player kill that makes sense, I am also planning in adding more ways to gain points instead of just 1 kill = 1 point, so i tried to make a uniform function that does the calculation and basically stack these numbers on top to then calculate the team value -- if that makes any sense

odd ember
#

anyway the calculation is the one you want to use. it's your setup that is wrong basically

#

and maybe the player camera manager

#

(potentially)

wise mantle
odd ember
#

it should still give you the same value

wise mantle
#

not when its minus

odd ember
#

well it's a value beween 1 and -1

wise mantle
#

these had to be swapped

odd ember
#

it is still a value between 1 and -1

#

it doesn't change

#

you just reverse the direction you are checking against

wise mantle
#

i mean... actually i have no idea. i just stopped with the weird location stuff, with positive and negative numbers

#

i can try to switch it back, 2 sec

wise mantle
potent laurel
#

@wise mantle there is a function called "was recently rendered on screen"

#

Or do you you mean directly looking at?

dawn gazelle
# mild flare hi! if it comes down to just adding +1 for a player kill that makes sense, I am ...

If your team score is just an accumulation of the points earned by your players on that team, then whenever a player earns points, you add whatever points they received into the team's points, not what the player's current score is. So if your player earns 1 point, that 1 point should also be credited to the team they are on, and that's it. If the player does something that adds 5 points to their score, then that 5 points should be added to the team's score.

wise mantle
# potent laurel Or do you you mean directly looking at?

yea i did try the "was recently rendered", it had some limitations tho. what CE showed me might work better. so far ive tried a bunch of different methods to know whether an actor is on your screen or not... i mean, i get that programming isnt the easiest thing in the world, but ive spend pretty darn much time on just figuring this out effectively

odd ember
#

basically what I gave you is comparing facing directions

#

with a tolerance

potent laurel
#

There is last time rendered on screen, aswell as recently rendered, aswell as time recently rendered. There is also a "line of sight" function. Don't really want to set you off track here but worth checking out if you continue to not find a solution

mild flare
#

thank you

copper steppe
#

Casting to BP_PlayerCharacter fails but I feel like this cast, in the PlayerController, should work, even though I can see it fails when starting the gameO_O
Or am I being stupid? angerycry

wise mantle
#

actually... from what ive gotten so far, @odd ember 's solution actually seems to work really well

odd ember
#

after the dot is true

potent laurel
#

Yup

odd ember
#

which is perhaps worth mentioning: dot has no way to see if there are any walls

#

you have to check that yourself

wise mantle
#

i have a raycasting system to check that

potent laurel
#

What is limiting about time rendered on screen?

#

Curious

wise mantle
#

but this works perfectly with the rotation of the player

odd ember
#

it's not time rendered on screen

#

it's last rendered

#

occlusion rules are not always straightforward

wise mantle
potent laurel
#

Oh ok

wise mantle
#

but thanks for the recommendation, and also thanks to @odd ember . i really appreciate it. this is working perfectly πŸ˜„

odd ember
#

player controller

copper steppe
odd ember
#

what?

#

how does that make sense

#

the wording alone should be pretty clear

dawn gazelle
#

The player state is owned by the player controller.

#

But even still, casting a player controller to a player state doesn't work. You need to get the player state first, then you can cast the reference to your desired playerstate class.

#

If you want the player character, then you can get the owner of the playerstate, then get the controlled pawn, then cast to your desired character class.

odd ember
#

where's that diagram

copper steppe
odd ember
#

that's not how object oriented programming works

#

the player state may have a reference to the player controller

#

but that does not make the player state owner of the player controller

#

in the pattern of UE4's multiplayer framework (I suggest reading the guide that one of the mods has made, it's probably pinned in the multiplayer channel), the player controller is the manager for all player related classes

#

this means player controller manages: player character, player state, player camera manager, etc.

#

so if you want any of those, you can go through the player controller

dawn gazelle
#

Caveat: If you're running something on the client, they don't have references to all player controllers, only the local one.

odd ember
#

yeah the server knows all, client only knows their own

copper steppe
#

Well casting from the player controller doesn't really work either so shrug

copper steppe
prisma stag
#

Hello, I have a pure function that has an output. The output is coming from a refernce variable and then getting a certain variable but what I want to happen doesnt seem to work.

#

Here is the function. Is this due to the ComputerScreenREF only being set once so anything that happens after that doesnt get applied?

spark steppe
#

no, the reference holds just a pointer to the real object

#

i guess whatever you are doing with the result might be wrong

#

the method you showed looks okay

#

except for it's weird name πŸ˜›

prisma stag
#

Hm. So the output of this function (Product Struct Map) goes into the input of an add function, so it should be setting the values of the Product Struct Map in the ComputerScreenREF, correct?

spark steppe
#

not sure, it might just return a copy of the struct

#

so it never gets applied to the real struct on your computer screen reference

prisma stag
#

Ah. Isnt there a pass by reference option?

#

Would that fix it?

spark steppe
#

that would fix it yes, but i don't know if you can return a reference

prisma stag
#

Ok. So what are my other options?

#

I have a struct variable in the current class so could I set cast to the Computer Screen, get that struct, then set the current struct to the Computer Screen Struct, then just reference the current struct as needed, then once does, set the Computer Screen Struct equal to the current struct?

odd ember
#

structs in BP are all copies, not pointers

#

which makes it a bit harder to manage them properly when you want to set them

spark steppe
#

if you do what you did in the function in the same graph as you add to the struct, it might work, but i'm not 100% sure

prisma stag
spark steppe
#

instead of making it a function at all

prisma stag
#

The only problem with that, is this pure function is used multiple times.

odd ember
#

technical debt is real

prisma stag
odd ember
prisma stag
#

That seem to have worked. Odd that using the pure function does work even though the contents of the function are the exact same as what is working now.

odd ember
#

structs in BP are nebulous entities

prisma stag
#

Yea. I guess doing it this way is nice as now I only need the referenced variable instead of updating this variable each time I needed the updated verison.

odd ember
#

I had an issue with my AI structs not working when I created them in BP. I then wrapped the same struct creation in a cpp function and everything was fine

prisma stag
odd ember
#

I don't think I did anything, but you're welcome I guess? πŸ˜…

trim matrix
#

anyone know what i have done wrong here? the actor wont be destroyed properly on clients

#

it stops taking damage but mesh remains

#

on server however it fully disappears

dawn gazelle
#

If it's a replicated actor, you only need to destroy it on the server.

maiden jay
#

Hey all, hoping to find an answer on here. I have an enemy character that can be hit and damaged by different kinds of projectiles, how would I set up the BP to allow for multiple hit events? Since I can only use a single hit event, I'm guessing I need some sort of flow control leading off of it, but I'm not sure.

sudden iron
#

anyone know why the line trace is not going straight?

#

here th bp i made

dawn gazelle
sudden iron
maiden jay
tight schooner
#

The "+" in the screenshot would add a flat 500 to each axis of the vector, which wouldn't produce anything useful

sudden iron
#

damn, its work lmao thanks man

sudden iron
#

btw, whats the meaning of vector * float? like how its work and why we should use it that way?

light token
#

What can I do to make this work. The left example is working. But when I connect a String node to it it's not working. I've got the C++ source and I think the UPROPERTY needs something more added to it. Anybody?

dawn gazelle
# sudden iron btw, whats the meaning of vector * float? like how its work and why we should us...

Vector * Float means you're multiplying each part of the vector by the Float amount.
So if you have a vector of 1, 2, 1 * 500, your output vector will be 500, 1000, 500

Your forward vector usually has values between -1 and 1 for each of the values to represent the "forward" direction. Multiplying it by 500 basically means 500 units forward, and then since you're adding your actor's location, that means 500 units forward from wherever your actor is.

dawn gazelle
trim matrix
#

didnt tick replicate on the actor in class settings or something

#

lol

light token
spark steppe
#

if im not wrong you download them for binary engine builds

#

however i highly doubt that the c++ code wont recognize the value, that seems unlikely

#

c++ doesn't actually even see any difference between a value provided from a variable vs. one defined in the input field

light token
#

Hello. I have a question. I have a blueprint with a static mesh actor. I want to have it not collide with other objects so I set it to "No Collision". But I also want to recognize it by "Get Hit Result Under Cursor By Channel" is there some other collision setting that provides this functionality?

spark steppe
#

use a custom collision profile and set everything to ignore except for the channel that you use for the trace

light token
#

Ahh awesome

#

thanks!

sick sapphire
#

Can UE4/5 translate blueprints into C++?
Feel like it should be able to since its the same functions

earnest tangle
#

UE4 has blueprint nativization which can do it to some degree, I think UE5 is removing this feature though

sick sapphire
#

what
removing it sounds like a step backwards

solemn zephyr
#

they probably plan to replace it with a translation to their in-house language they're working on

earnest tangle
#

From what I understand it has a number of caveats, and it's not that hard to rewrite performance intensive blueprints in C++

#

Majority of the time BP performance is entirely adequate so you don't really even need that feature

sick sapphire
sick sapphire
solemn zephyr
#

if you know how to write it sometimes it can be faster than laying out all the bp nodes or there are some things you can write more efficiently performance wise I suppose

earnest tangle
#

I write a lot of my core logic in C++ because I find it's a bit more robust that way

#

I use blueprints to do some more gameplay related logic on top, like triggering sound effects or such

solemn zephyr
#

nvm I realized an addon is probably the best and easiest answer to my problem

storm vigil
#

Hi. May I ask how would you go about attaching a weapon to a socket when the animation switches the main hand during reload? I usually have a problem like this one wherein a specific animation uses the right hand to reload something and the left hand tries to grab the gun. But if the reload animation reloads with the left hand and the right hand is holding the weapon, I have no problems.
Currently I am using procedural weapon sway on my setup and left hand transform to position the left hand. The gun grip point is attached to a socket under hand_r bone. I believe it is related where the grip point is attached like the socket hand_r bone but I saw some templates before that also uses the setup but I could not pinpoint how they are detaching the socket during a reload animation like this one. My current alternative is to dynamically change the grip point during this type of animation, transferring to a left socket on the left hand bone.
Thank you

icy dragon
# sick sapphire what removing it sounds like a step backwards

Sounds like step backwards, but it's a step forward because it's an abomination.

Not only does the C++ code unreadable (think of it as what reverse engineering tool outputs without any manual labour), it's not intuitive to set up. Some blueprint asset types refuses to get nativized, like struct/enum assets

harsh hedge
#

How to move static mesh component in the viewport?

tawdry mural
#

select it in details pannel

harsh hedge
#

There's only scale

maiden wadi
#

Then it's a root component. You can't move a root component since it's what everything else relies on for moving.

tawdry mural
harsh hedge
#

So i shouldn't make the staticmesh as the root component?

maiden wadi
#

Not if you want to offset it from the actor's root position.

#

Actor's Position is always it's root component's position. GetActorLocation for instance literally gets the root component and gets it's position. So you can either move the entire actor to move the mesh, or the mesh needs to be parented to something else like a SceneComponent.

harsh hedge
#

Yea i'll just make the scene component as the root

timber cloak
#

What's different between Interface and Function?

#

Seems like same thing aren't they?

drowsy heron
#

someone help pls

#

im trying to get this HUDCanvas but it wont pop up as by him

earnest tangle
#

Did you try connecting from Heads Up Display and finding HUDCanvas?

drowsy heron
#

im trying to connect hudcanvas to add child canvas as a target

#

but my hudcanvas is character sheet

#

and there is a border of the character equipment and stuff

earnest tangle
#

well unless your character sheet is of type canvas this isn't going to work

drowsy heron
#

and his hudcanvas is empty, and im very very confused

maiden wadi
#

@timber cloak Sort of. I think you're thinking of an Interface Function vs a Class Function. An Interface is like a secondary class that multiple classes can use to call similar functions on multiple different objects.

barren belfry
#

Why does my multiboxtracebychannel not hit all of the cones? As you can see, the red lines are the box trace boundaries, and I tell the cone to turn green if it is hit by the box trace. It returns values very inconsistently

brittle plinth
#

hey guys, do you know how Can i have a cutscene on a first person game that has a blend between the actor's view camera and the sequence camera?

brittle plinth
#

Also, How can I disable just the movement

#

and not the mouse input ?

#

umm

#

oh so i setup a flying movement

#

and setup the movement speed to 0

#

that' should work

fierce axle
#

Hi, I would love some BP assist with a tricky problem! I have a vector (weapon muzzle) that i need to know the rotation of to face where my cursor is, but the rotation need to happen around my characters origin point. I can kinda do this with a RotateVectorAroundAxis node, but instead of giving me a consistent result the corrected point just orbits around the origin, where as I need a fixed position. I am doing this to check LOS between my weapon muzzle and cursor regardless of how my char is rotated. Any tips on how to accomplish this?

sudden iron
brittle plinth
#

If i have an animation that walk forward, how can I put the same one and not resetting to the original position?

gritty elm
fierce axle
#

My issue illustrated:

gritty elm
fierce axle
#

the cursor could be anywhere though. im not trying to look directly behind the muzzle, sry if my illustration is a bit confusing.

gritty elm
#

get hit result under cursor by channel will convert mouse location to world space location. from that location you can add to -muzzle forward vector, which is explained above

fierce axle
#

yeah i have no problem finding the location of the cursor.

gritty elm
#

you need to negate the forward vector

barren belfry
fierce axle
#

Im not really sure about this -5000? my objective is to find to location of the yellow point

gritty elm
maiden wadi
#

@fierce axleIs this top down?

fierce axle
#

its third person

#

@gritty elm sry im probably not explaining it right, but i cant get that solution to work, thanks though!

maiden wadi
#

Pretty sure you're looking for Deprojecting the mouse location. Via PlayerController. You can use that in a LinePlane function at the player's location

#

Are you doing this in the character's blueprint?

fierce axle
#

im not trying to find the cursor. i can already do that fine.

#

yes

#

i need to rotate the muzzle point around the origin of the char somehow. after that its easy enough for me

#

i can already do the LOS check from origin to the cursor but thats a bit imprecise. i want to make the LOS check from where the gun will be IF i decide to fire.

#

sry its technically top down i guess? just not directly 2d topdown but the ARPG view.

maiden wadi
#

This is complicated for the simple fact that animations move the muzzle. If those are taken out, then the math for it is fairly simple.

fierce axle
#

what would that roughly be then?

maiden wadi
#

If I'm not mistaken. This should be fairly close for a start point for the muzzle.

fierce axle
#

oh thanks, ill check it out!

mint mica
#

would someone be able to help me this linetracing problem?, it's likely something painfully simple , i've done a simple placeable cube and when i build one on top of the other (so 2 cubes high) the line tracing only gives a valid position that lets me place more cubes as long as either the x or y is greater than the target cube,

odd ember
fierce axle
#

Yeah depends on the weapon

odd ember
#

or is it automatically handled somehow?

#

ok

#

there is deproject screen location to world

#

once you have the location of the cursor in world, you can find the corresponding forward vector you want the muzze to be at

#

basically it's (Origin.Location - MouseInWorld.Location).Normalized(). then you can do something like RotationFromXVector to find the rotation

#

that leaves the issue if how the muzzle is rotating. if it's parented to the origin actor, you may want to rotate the actor instead of the muzzle

fierce axle
#

oh i dont want to rotation the actor here. the main objective is just to "know" if i will hit a target "if" i shoot.

#

when scanning around with the mouse

odd ember
#

I see

fierce axle
#

so i can put an icon over the targets head etc.

odd ember
#

then you should still get that unit vector, and compare to the forward vector of the muzzle via Dot

fierce axle
#

yeah ive used that for the rotatevectoraroundaxis thing

odd ember
#

that will give you a value in range of 1..-1, where values closer to 1 are pointing in the same direction, and values closer to -1 are pointing opposite

#

you can then granulate exactly how close you want it before it registers

fierce axle
#

but isnt there just plainly a way to rotate a thing around another thing?

odd ember
#

1 means the unit vectors are an exact match

fierce axle
#

if my only output is a strict rotation then its still just rotating around ist own axis no?

odd ember
#

you have to rotate the parent

#

you can do this by either rotating the main actor it is on

#

or you can create a parent scene component

fierce axle
#

hmm okay

odd ember
#

in either case, when the muzzle is parented, the difference in origin will rotate with the parent

fierce axle
#

well im not stricly trying to rotate the muzzle but rather "know" where it will be

odd ember
#

the calculations are still the same

fierce axle
odd ember
#

the only difference is that you don't apply them

fierce axle
#

like something like this node, only it keeps rotating for each frame

odd ember
#

you can use FindLookAtRotation aswell

fierce axle
#

yeah im using that a bunch

odd ember
#

so you should be set then

fierce axle
#

thanks ill look into.

pure walrus
#

3D rotations = pain

dense perch
#

what's the proper way to store/access data I'm calculating via blueprints in-editor which won't change in the shipped game?
I was thinking I'd use Save Game.

odd ember
#

can you give a concrete example?

tight schooner
#

Save games could work β€” I use one for a custom visual logging thing. You can also mark actors & components as "editor only" IIRC.

dense perch
# odd ember can you give a concrete example?

one example: In a static, voxel-based map, I'd store line-of-sight data per-voxel. (i.e. each voxel would have a list of every voxel it has line of sight of within x radius)
I'd use this data for some shading effects

odd ember
#

that's... a lot of data

#

I doubt you could use that realistically in any sense in BP

dense perch
#

you're making assumptions

odd ember
#

voxel engines are potentially infintie

dense perch
#

the scale would be very small, but that doesn't really matter because my question was meant to be a general one

royal trellis
#

whats the cheapest physics object type? sphere collision? probably better than having a custom collision for a rock, right?

odd ember
#

never mind data management

earnest tangle
static charm
#

yes the simplest collision is better, but ive tested hundreds of physics objects colliding in a scene and saw little difference between the types.

#

generally it's object traces that you see the difference

earnest tangle
#

simplest way to do that would probably just be to sphere trace on tick across whatever duration you want for it to expand

dense perch
# odd ember never mind data management

point is, if I have something calculation-intensive that doesn't need to be done at run-time, how would I store and read that data?
I'm just gonna use Save Game in the future.

odd ember
#

there's Timer

#

I think I've done similar, I believe I used timer in this case (but actually timeline might be best for this given you can use that as an alpha value for the sphere's scale)

unkempt musk
#

@swift pewter
What about doing 3 sphere traces separated by a short timer? Inner ring fires and freezes, then middle ring, then outer. It won't be the most gradient, but it should get the job done.

tiny vale
#

what is the best way of getting a object from a class reference?

#

I dont like using get actor of class here

odd ember
tiny vale
odd ember
#

instead of showing us what you have

#

perhaps explain what you want to do

static charm
#

if the player buys weapons, and they already exist as actors in the world, then just save the actor refernce from the start of buying them.

tiny vale
#

Its a manage gun input function that takes 2 integers (Gun to Disable and Gun To Enable) that come from this , i want to take the object at the integer and remove its input,collision,visibility etc and do the opposite to the GunToEnable int in the array

odd ember
#

in that case it would be better to iterate over an array where all your guns are stored

#

and then based on the current gun picked, you can do your logic

worthy frost
#

feels messy what you are doing also

#

you already know what weapon is selected from Weapon Selected integer

#

not sure why Gun Input is taking in those integers..

odd ember
#

yeah I would perhaps use a state machine in this case

#

given that you can only have one gun active at a time

#

(I assume)

odd ember
#

although the level of repeat logic per state might not make it worth

worthy frost
#

i literally store a variable "CurrentWeapon", and when player switches, i change CurrentWeapon to the new weapon

odd ember
#

hmm yeah okay

worthy frost
#

this is a reference to the weapon, but my switch logic, calls CurrentWeapon -> Unequip then sets new weapon to CurrentWeapon, then calls CurrentWeapon -> Equip

odd ember
#

that plus a delegate OnCurrentWeaponSwitched

#

where you can pass the weapon itself as a variable

worthy frost
#

that is it, weapon handles hiding/showing itself

odd ember
#

I see

tiny vale
#

Yeah i guess ill remake the system you guys gave me better ideas

#

thank you

worthy frost
#

mine is a tad more complicated, as it waits for the weapon to finish being used, etc.

#

but that is the general gist.

#

i have very little weapon code in the Character

tiny vale
odd ember
#

do you spawn weapons as actors and then attach them?

worthy frost
#

yes

#

all weapons are actors

#

@tiny vale yes

tiny vale
#

yea im only doing that on the character

worthy frost
#

but they call into the weapon, and weapon handles hiding/showing itself

tiny vale
#

rest is on the WeaponBase

worthy frost
#

Unequip function hides the weapon and detaches it from the player

#

Equip shows the weapon and attaches to the player

#

these are functions on the weapon, reason being is weapons can be attached to specific sockets

#

with specific offsets on the socket

#

which only weapon knows

#

mine is C++, or i would show you πŸ˜›

odd ember
#

sounds like you want 2 different things that are at odds with each other

high ocean
#

I think what I did during the last few years of working in UE is bad practice, but there's not enough info out there to confirm it: I've been creating user widgets in various places like game instance, controllers, other widgets, individual actors and followed the "rules" which made sense at the time. Now that I want to reuse older work for a new project, I realize the UI com systems are so convoluted it stings my brain. Never used the HUD class for some reason πŸ€·β€β™‚οΈ
This IS bad practice - isn't it? Even if it's more work at that very moment, shouldn't I have a certain class that handles all the user interface & coms? Some pro advice pls πŸ™‚

odd ember
#

yes

high ocean
#

@odd emberπŸ˜‚ fair enough, short and to the point πŸ˜›

odd ember
#

the general rules for good practice are:

  • each class, in as much as possible, is responsible for itself
  • a manager should have responsibility for communication and instantiation of each class
#

see also: MVC

high ocean
#

@odd emberYep, looks that way now, came to that conclusion, but wanted confirmation. I'll also save the MVC pattern - never heard of it btw. Try to follow it. Thanks! πŸ˜„

#

And would HUD be a good manager class for all widget comms?

odd ember
#

MVC is at the core of designing the player experience

devout dove
#

How do I setup a HOTAS controller in BP? HOTAS is the airplane joystick with the acceleration slider thingy.

odd ember
#

no clue, there might not be support for it without plugins

#

perhaps you can check the USB game controller utility in windows if you're using that, and it will give you some notion on how to translate input which could then be used with the standard BP input

high ocean
#

πŸ˜• Having to do everything myself as an indie, couldn't afford properly studying anything really. Jacks of all trades stay jacks for a reason - unless you're a genius, which is hardly the case lol - so I came to various "standard" conclusions from experience and digging on a subject when confronted with it. @odd ember

#

Another question and I'll leave u guys alone πŸ˜›
Can you give me any link/keywords on how to search for (I don't know how it's called) - but I feel like I don't have consistency in how I do things, so whenever I need to revise/revisit older code after working something completely different, I'm lost and have to spend hours remembering/figuring out how tf I was doing things. Especially in bigger projects, it's such a waste. There has to be some model/way of doing things so that anyone looking at the code and knowing the model can understand what is going on... What is "that" called? Any documentation would be really helpful. Thanks!

odd ember
#

believe me if you did need genius level understanding we'd see a lot fewer people doing game dev

high ocean
#

I'm and was in the wrong trade all my life - PhD in Educational Psychology, started as a musician so yea... But I love this, sad I didn't do this when I was young 😐

odd ember
#

I think in your case I'd just try and sit down and study programming principles for OOP

#

OOP being Object Oriented Programming

gentle urchin
#

For consistency i tend to find a programming pattern i like/find suitable, and try my best to stick to it

maiden wadi
#

Honestly, there isn't any way to really go back to something after a while and just know it. I find myself looking at things after a few months that I've done, and it takes glancing back through my calls to realize what I was doing and why. The best you can do is just write organized code. Break things down, don't chunk stuff up into large functions.

high ocean
#

Ok, great, that's a good way to start I guess πŸ™‚ Thank you!

odd ember
#

it might be a bit dry, but ultimately it's going to give you a lot of insights into how to structure you game

gentle urchin
#

Along the journey one often picks up new tips and tricks, so every revision may differ despite following the same principle

odd ember
#

and it is extremely important to keep many of these principles in mind so you don't accrue technical debt at an alarming rate

#

(you'll always accrue some degree of technical debt, blame entropy)

#

but if you set yourself up correctly from the beginning, many of the things you need to do will be laid out for you later on

high ocean
#

I'm fine with dry, so I'll read up on that - fortunately, reading doesn't scare me at all πŸ˜„

odd ember
#

in the case of my personal project, I spent about a year laying the groundwork for a game framework

maiden wadi
#

Some people say to comment code and such. Maybe. I dunno. I find comments annoying and distracting. Logic should make sense on it's own. If they help though, use them.

gentle urchin
#

Good code is self explaining

#

Comments tend to be part of bad habits, atleast thats how i see it

odd ember
gentle urchin
#

Letting yourself get away with weird code because you put a comment above it..

odd ember
#

good code doesn't exist

high ocean
odd ember
#

good practices exist

gentle urchin
#

Fair enough

odd ember
#

I just linked this yesterday

#

but it is as valid as ever

odd ember
#

or really, any kind of development for money

high ocean
#

well then, I'm "standard" πŸ˜„

odd ember
#

experience comes from understanding how bad decisions came to pass

#

and knowing how to avoid them in the future

#

you're working alone now, so your decisions only affect yourself

#

but imagine if you were responsible for a team

#

or a department

#

or a studio

high ocean
#

Don't even wanna think about that. I had the freedom to "adjust" the very game design according to what I deemed feasible during the timeframe + budget. It would have been impossible to do it if I worked with a team - so yea, ur perfectly right!

odd ember
high ocean
gentle urchin
#

Funny, and yet very true

#

looks at Phil

#

Another issue i often encounter is over engineering

high ocean
#

Don't doubt it πŸ˜‚ It's kind of like this in any academic/research field imho. If not even more so πŸ˜„

gentle urchin
#

Mostly done by myself

odd ember
#

over the years I've seen many people fall into the same traps

gentle urchin
#

Instead of sticking to the projects actual needs, i tend to overthink and overcomplicate the systems that i needed, ending up wasting a massive amount of time on it, only to use like 10% of it

odd ember
#

over engineering, preemptive optimization, shortcutting the learning process etc.

#

it always comes back to bite them/everyone in the behind

gentle urchin
#

Yepp

#

Whats the phrase, make it work, make it work good, optimize if needed?

odd ember
#

make it work, make it neat (readable), make it fast

gentle urchin
#

^ thats it

high ocean
odd ember
#

set up your architecture first

#

that's the core of this

high ocean
gentle urchin
#

Constrain yourself :p

#

Its no easy fix

high ocean
#

yea, ofc there isn't πŸ˜›

odd ember
#

programming is much less about doing logical statements and operations and much more about how to manage those logical statements and operations in structures that make sense, that can be extended and that don't require (excessive) detangling

high ocean
#

but I think i've heard in some Epic livetraining or read up somewhere about some conventions meant to streamline coding workflow. Can't remember what it was called, can't find the vid for the life of me.

#

I'll just start with OOP principles, see where they take me. The problem I faced trying to read up on that is the terminology which is next-level of abstract (psychology is baby science compared to it). And I somehow need to translate those in blueprint language (which I probably can't). But I'll find a way to wrap my head around it. πŸ™‚

maiden wadi
#

I think it's important not to try to overdo something. You're going to miss something, or mess something up. Set things up in the simplest manner possible, and then add onto them when you need to. Trying to do anything more is just wasting time.

odd ember
#

also it's worth keeping certain game design/fungineering notions in mind:

  • have a core game loop that you can scale up/down
  • extend the game only insofar it benefits the core game loop
  • layer esoteric decisions on top of the core game loop only if you can prove that you won't have to modify the core game loop to include them
#

GoF description of patterns are legendary in how terribly written they are

maiden wadi
#

GoF?

odd ember
#

spoken like a true veteran in the field πŸ˜‚

odd ember
#

just to add a final point to this conversation: I mentioned technical debt before, but didn't really go into detail. just in case, https://en.wikipedia.org/wiki/Technical_debt

Technical debt (also known as design debt or code debt, but can be also related to other technical endeavors) is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy (limited) solution now instead of using a better approach that would take longer.As with monetary debt, if technical debt...

high ocean
#

Great! thanks for the resources & input everyone! πŸ™‚

odd ember
#

sounds like you could try asking that in #animation

#

not sure what it has to do with BP

flint anvil
#

its kind of both but ill post in there just in case

bold wasp
#

Anyone know how to remove foliage instances on collision? This isn't working. I know the hit event triggers but it doesn't get removed.

maiden wadi
#

Break the Hit struct and try using the HitItem as the index.

#

It's either HitItem or HitElementIndex. Can never remember which off the top of my head.

odd ember
#

I can't imagine instanced foliage has blocking collision, let alone generates hit events

#

perhaps try with overlap instead?

bold wasp
#

It does have hit events .. we're talking trees here.

#

Like I said that part works. Just can't remove it. I'm super new to blueprints too.

#

Tried this also, it's not working either

#

@maiden wadi i am not familiar with that approach. I will try and look into it, thanks.

odd ember
#

I mean you can have the Event Hit as a node

#

that doesn't guarantee that hit events are being generated

maiden wadi
bold wasp
#

ah

#

Oh shit something happened! It just destroyed all the trees instead of one. But it's progress!!!

maiden wadi
#

Break the blue pin at the bottom and try what I mentioned above.

wispy solstice
#

Hi I'm working on an action hack and slash type of game. When the player attacks I want there to be a small amount of aim assist/lock on to the target if there are not quite exactly in front of the player's cross hair. How would I got about implementing something like this?

maiden wadi
#

Hit struct is populated with the instance of the ISM when colliding with it/tracing it. Did a lot of that for a building system.

bold wasp
#

@odd ember I have no idea if it's just an UE5 thing because I didn't actually use UE4 but yeah the block / hit events on foliage definitely work I printed a log message before

static charm
#

Auth is correct, then you can use RemoveInstance node with the item/index number from the Hit.

bold wasp
#

ty

gentle urchin
#

Animstate

#

With directors to next combo

#

Which is a new section in the montage

#

Ye

#

As always theres a 100 ways

#

But the epic one seem pretty solid

#

Could probably adapt it a tad to make it work with different montages instead of sections

#

I was planning on it in one of my projects, but figured it'd be one heck of a setup for something inprobably dont need (as talked about above, with overcomplicating stuff that dont need to be )

bold wasp
#

It's not working @maiden wadi

maiden wadi
#

What is hit item printing?

bold wasp
#

73

#

I thought maybe the target passed to "Destroy Instance" was wrong ... but it won't let me pass the "Other" variable from "Event Hit" directly in there

maiden wadi
#

Odd. That should be working.

odd ember
#

isn't it because you're going too deep in the hierarchy?

gentle urchin
#

^ i was thinking this too

#

But.. the validator works

odd ember
#

I don't know how ISMs are setup on the inside

static charm
#

use Hit component from the break hit, cast it to foliage, then remove instance.

odd ember
#

if it's a parent ISM that has child ISM components

bold wasp
#

ok I'll try that Gallonmate thanks

#

I think it works

#

I mean it's kinda wierd with the whole Lumen thing

#

but thanks a ton

#

I mean it's kinda wierd like it's deleting unrelated instances

#

Idk

#

Ok I got it

#

I need to combine that approach with the Hit Item index

static charm
#

yeah sorry didn't mean for you to remove that wire lol

bold wasp
#

It's cool I think I am getting what an Instanced Static Mesh is .. like it is not itself a single instance, but a collection of instances

#

Next step is to try generating a different mesh in its place ... but that might be for another time..

#

The context here is like a monster stepping on a forest and so the trees get replaced with fallen trees

static charm
#

there's tutorials out there for swapping instanced meshes, chopping trees is the popular one that pops up first when u google it

bold wasp
#

ok cool thanks

narrow lion
#

Hello i have made a Controls Option Menu where i want be able to change Input Action and Axis Bindings but i want them to save after you exit the game and start over .Is there a way? I am using the Save Key Mapping Node but after i exit the game . It shows that everything has been unbounded

deep hound
#

is there an efficent way to retrieve an item from a map with a gameplay tag being the key without looping? I know i could just loop over the keys in the map and call HasTag on the container, but i'd like to avoid looping and do a straight grab from the map.

spark steppe
#

isn't there getAllActorsWithTag or something?

maiden wadi
#

Find?

spark steppe
#

whatever, unless you don't overdo it, you can go with it

maiden wadi
#

GameplayTags, not FName Tags.

spark steppe
#

also depends on the amount of actors in the level

#

oh, i see

static charm
#

im confused , why can't you use Find

maiden wadi
#

@deep hound Fairly sure this is what you're after?

#

I mean. It still loops internally, but it's a lot more efficient than BP loops.

#

I use it pretty often with UI setups.

surreal peak
#

Why would that loop

#

That would defeat the idea behind a TMap

spark steppe
#

maps use a hash, don't they?

surreal peak
#

Yes

#

Which is slower than the Loop if it's only a few elements I guess

#

But there are always freaking Terms and Conditions

odd ember
#

it's still cpp so it resolves faster regardless

surreal peak
#

Iirc the GameplayTag is an FName and those are mapped to an Index anyway?

#

So it should be fairly cheap?

#

Idk how that all works deep down, but either way, it's not a loop.

maiden wadi
#

Dunno. The thread I followed before leads right to a loop.

deep hound
maiden wadi
#

The Map's key is a Tag, or a TagContainer?

deep hound
#

the map contains keys of GameplayTag, while the item i'm using to get something out of the map is a GameplayTagContainer

surreal peak
#

Then you might not get around the loop

static charm
#

how do you know what gameplay tag you want from the container?

surreal peak
#

C++ might have some lambda based find, where you could put some custom condition into

#

I think the diea is

#

That they want the value

#

of the tag

#

That is part of the container

#

E.g. "Loop over Tags, check if Tag is in Container, if so give value."

#

You could turn the Container into an Array.

maiden wadi
#

What is in the container? I mean if the container only has one tag, convert it. Otherwise you're looking to retrieve multiple things anyhow.

surreal peak
#

And loop over the Container

#

And then use the find

deep hound
#

maybe it's easier for me to describe what i'm trying to acomplish. I'm trying to categorize items in a container by tags. An item would contain this tag within all the tags it has. Categories would always be something like Game.Items as it's parent. So a valid category is Game.Items.Ammo. Game.Items.Ammo would exist in the map as a key. Give an item's gameplay tags, i want to retrieve the matching item from the map.

#

does that make sense?

surreal peak
#

Yeah sounds like a loop to me

deep hound
#

Originally i just had a switch statement with all valid tags, but that requires hard-coding all possible tags in my function, which becomes difficult to maintain

#

my approach now is to pre-define the map with all possible keys, and just iterate that

#

but i'd like to avoid iteration if possible

odd ember
#

I wish FName functioned like the dynamic Enum type it was meant to be πŸ˜”

surreal peak
#

So Game.Items is part of a Container with multiple Tags inside an Item

#

And you have Game.Items.Ammo, Game.Items.Weapon, etc. in the TMap

#

And you wnat to get all the TMap entries that have Game.Items

#

Something like that?

#

How many entries are we talking about

#

In the TMap?

deep hound
#

not quite. the idea is that the item might contain multiple tags that aren't just the Game.Items parent. I want to say, given this item's game tags in the container, find the relevant entry in the TMap. As for the number, so far around 15

#

the ONLY items in the TMap are Game.Items already

surreal peak
#

What's the worst case of num entries

deep hound
#

idk, it's whatever the number of categories the game designer comes up with

surreal peak
#

Anything around the thousands?

deep hound
#

lol i'd hope not

surreal peak
#

Then you are optimizing the wrong end

#

HashMaps aren't superior to Loops in low numbers

#

So just loop

#

eh

#

Aren't

#

fucking brain of mine somtimes

deep hound
#

lol yeah

#

i figured

#

just thought i'd ask if there was something i was missing since i'm fairly new to gameplay tags

#

thanks tho!

surreal peak
#

Na, the conversion between Tag and Container for something like a key is not that straight forward

#

Or possible

#

Not helping here, but also have a look at GameplayTagQueries

#

Sometimes they help and not a lot of peeps know them

deep hound
#

is there a "null" state for a tag?

surreal peak
#

With the limitation in mind you could also check if you can replace the TMap with something better here

deep hound
#

like can I reset a variable holding a tag to nothing, and verifiy it's nothing?

surreal peak
#

NAME_None

#

Is the invalid state of a Tag

deep hound
#

would this be true?

surreal peak
#
FGameplayTag someTag = ...;

if (someTag.IsValid())
{
  someTag = FGameplayTag::EmptyTag;
}
#

Not sure how that would look like in BPs

#

But you best just check the API

mild jacinth
#

can someone give me some information on how to create a death respawn timer? e.g player dies, the umg widget gets created and added to viewport, then countdown starts from 5 to 0, once it reaches 0, all widgets get deleted, and player will respawn..
i have only found so far a lot of info on using tick function, but tick runs at the start of the game always? how to make it so that when i overlap, i can call a custom event which adds/removes seconds?

trim matrix
#

Is there something more to the question I’m not understanding cause that answer seems to simple lol

mild jacinth
#

I have created an overlap event which destroys the character after 5 seconds, and it also adds a UMG widget to the screen. My question was, how can I make the countdown in the UMG go down, from 5 to 4, then from 4 to 3, etc, until it reaches 0. I don't understand how would I achieve this. would I have to use some type of loop with -- decrement int to remove it 1 by 1? it doesn't work.

trim matrix
#

So you mean a visual indicator then?

#

In a umg?

mild jacinth
#

yeap

trim matrix
#

Oh ok

mild jacinth
#

i put the variable into playercontroller and casted from UMG to playercontroller

#

to get it

#

but idk how to decrease the value after i touch the actor

trim matrix
#

Well you can use a umg binding, or yes, you can make a looping timer to handle it.

#

Might just be simpler to use a looping timer

mild jacinth
#

right now basically i have a set timer by function name, and that custom function destroys the actor after 5 seconds

#

but yeah the visual is problem

trim matrix
#

Then

#

Change the timer duration to one second, and make it loop

#

And make a counter variable

#

Each iteration of the looping timer, increase the counter

#

When counter equal to or greater then 5 destroy actor

#

But

deep hound
#

is there a way to hit a breakpoint for design-time blueprint code in widgets?

trim matrix
#

On each iteration,

#

Also update the UI number

mild jacinth
#

what type of loop would be best for this?

trim matrix
#

I mean you can keep using the timer you have

mild jacinth
#

oh ok

trim matrix
#

There is a setting, when you set the timer, that makes it loop

#

But

#

You could also just set a new timer at the end of the timer finish function

#

But why not just use the looping Boolean

#

Easier

odd ember
#

since this is all based on the player controller's relationship with the pawn

#

you could bind events to activate OnPossess

#

likewise you could do the same with OnPawnDeath

#

bind all widgets (or the widget controller) to destroy widgets when the pawn dies

#

when a new pawn is possessed, spawn new ones

trim matrix
#

I’m not sure if that’s answering his question

odd ember
#

it does

#

having a delay or timer between is trivial

trim matrix
#

Except that’s the part he’s confused on smh

#

No trivial to everyone

#

And that’s the part he’s asking about

surreal peak
#

The thing is, there are a gazillion ways to do this

odd ember
#

either way you'd activate the delay (however you'd want to implement it) OnPawnDeath

trim matrix
#

Yep

surreal peak
#

You can even put the timer into the widget

#

Or have the widget play a sequence

trim matrix
#

Yes lol a million.

surreal peak
#

If you want to help them either go into detail on how they are doing it atm

gentle urchin
#

Can a controller be without a possesed pawn for a while? In relation to op question

surreal peak
#

Or give enough info, cause throwing random things like possess into the mix will confuse them

#

Yes it can be

#

Pawns are optional

gentle urchin
#

I see. Thanks

odd ember
trim matrix
#

Bruh

surreal peak
#

Maybe. But it's not the top solution either depending on what they are doing

#

They wanted a visual number

#

That counts down

#

That's kinda all

#

Which if we keep it to umg would be a timer in there or a sequence. Given they already have respawning setup

odd ember
#

if you accumulate tick time and truncate it to int it'll automatically preserve time format (e.g. 1 second per int). then it's just about updating the widget, either per tick or whenever it reaches a whole number

#

SetText or the like

#

so something like RespawnTime = RespawnTime - GetWorldDeltaSeconds in a timer or per tick will work

trim matrix
#

Yea that route would work to.

#

But it’s kind of confusing

#

I wouldn’t know what your talking about, if I didn’t even know how to make a looping timer update something

#

It also ignores his foundation that he already has

#

He’s already using a timer handle

odd ember
#

this can be done inside a timer

#

doesn't really matter

trim matrix
#

Yea

maiden wadi
#

For display timers, I was always a personal fan of just using a start time and duration. Pass that to a widget, let it tick and display the timer based on GetGameTimeSeconds and some math. Tick isn't gonna do much here unless you're planning on having a thousand of them on screen.. and at that point.. what the shit are you even making? Method works very well with networking too since you pass two floats, once, and let clients simulate it with GetServerWorldtimeSeconds.

light token
#

Hello. I'm making a particle effect. Now I have this gradient. I can change the Red outer color. But how do I change the yellow inner color?

maiden wadi
#

Used to remember that. On a side note, it's worth a mention that Cascade will be removed sometime in the future. Good time to start learning Niagara. πŸ˜„

light token
#

I did some Niagara tutorials and liked that a lot more. This effect was in a free FX pack I got from the marketplace.

odd ember
light token
#

Ok will try it there, thanks a lot

#

Oh man I don;t know how I did it but I changed it to red already xD

#

Sorry for asking in this channel.

prisma stag
#

When I call this for the first time, it works, however when I try it again ingame, the menu doesn not appear.

odd ember
#

if you try with breakpoints, you might be able to see why it stops working

#

it's hard to tell just from what you're posting here

prisma stag
#

Well now I am confused. I added a breakpoint on the IsValid node and it never activated.

What is supposed to happen is when E is pressed, the event dispatcher is activated on this actor and I add a widget to the players screen. I didnt want to keep creating the widget so when the game first runs, the SCS REF variable is empty so the variable is not valid, so it creates the widget and sets the variable so that the next time I try to open the widget the ref variable is not populated so I just use that variable and add it to the viewport.

odd ember
#

I can see what the code is supposed to do

#

but if it never activates then that's probably where the focus should be

#

I can also see that you mentioned dispatcher... but the event is an interface call

prisma stag
odd ember
#

so I'd investigate and see why the interface call is never made

prisma stag
#

Ok, so I added a print string to the end of each set input modes with different colors and they both show up one after the other as they are supposed to, but the top one never seems to show the widget.

odd ember
#

again, breakpoint it and see what happens. if it doesn't show up as going through the breakpoint, then you might have to change the actor instance from "none"

#

sometimes it does it automatically, sometimes it doesn't

prisma stag
odd ember
#

I don't have the editor open right now, but while PIE is running, you can change the between the actor instances that are running in the game

#

so you can check the breakpoint of each individually for instance

devout latch
#

How are you hiding the menu after the first time?

odd ember
#

sometimes it doesn't automatically take you to the first breakpoint on an instance, so if the print string triggered but the breakpoint didn't... you'll have to switch it

devout latch
#

or are you removing it from parent?

prisma stag
devout latch
#

You could just hide it and then show it again.... It's easier that way.

#

Especially if it's being used a lot in your game.

#

Then you can change your code up a bit.. I always create my often-used widgets upfront and then just show and hide them throughout the game.

prisma stag
devout latch
#

You can just hide your SCS widget object

#
  • yes, with set visibility
wispy solstice
#

how would I go about making a simple dodge left and right?

odd ember
#

you'll have to be more specific

#

where is your camera, how do you want the dodge to be

wispy solstice
#

oh yeah sorry, here is where its a bit too complicated for me ( Im very new). The camera will lock onto enemies and follow them and I want the player to be able to dodge either left or right. Camera is behind the player. For now since im just trying to figure stuff out I just want the player to be sent in either direction

odd ember
#

this would usually be handled through animations with root motion if you're thinking about something like dark souls

#

but if you want something simple where it's just the movement that matters, if it's something where you need to do it over time, you can consider a timeline that lerps an offset or an alpha value for an offset

wispy solstice
#

Okay, ill try my best with this. Thank you

prisma stag
#

So I changed my system to show the widget and this is what I have, however the widget doesnt show.

#

The variable there is set, and the event does fire.

devout latch
#

Is the Cast failing? Are you adding the widget to the Viewport somewhere else?

deep hound
#

is there no way when debugging blueprints to allow the game to resume until the next breakpoint is hit?

prisma stag
#

wait a second.

deep hound
#

because "Resume" seems to ignore my breakpoints again

devout latch
deep hound
#

it's not happening 😦

#

resume just ignores my breakpoints

devout latch
#

What if you put a breakpoint on two back to back nodes? Does the same thing happen?

deep hound
#

now that makes it work

#

wtf is that about?

devout latch
#

That was a test to see if your game is actually making it to another breakpoint when you resumed...

#
  • it looks like it's not.
#

I mean making it to another node where you have a breakpoint.

deep hound
#

but it does

#

i have a print string

#

i put a breakpoint on it

#

the print string executes 3 times, but the breakpoint would only hit once

#

when i added a breakpoint to the subsequent node, then the debugger stopped on the print string each time

devout latch
#

Hmm...that's strange. I'm not aware of the editor adding logic to do that. And you've tried closing and re-opening the editor?

deep hound
#

i have not

#

but for now the double breakpoints is helpful

devout latch
#

Maybe something got out of sync. I'm glad that was helpful. Good luck.

prisma stag
devout latch
#

When you go out of the widget that you are hiding? It shouldn't call the construct again since you aren't removing it from parent..

prisma stag
devout latch
prisma stag
#

That seems to have worked. Thanks.

devout latch
deep hound
#

So I'm using PreConstruct to put some data in during design time to help me visualize my widgets while designing them. The problem is whenever I nest them, their pre-construct code still runs, which duplicates items that shouldn't be there. Is there a way to disable the pre-construct event when creating a widget?

odd ember
#

don't think so, no. I think it's best to look at it as an encouragement to not place code there that you don't want to run at those times. but perhaps #umg can tell you more (or something different)

deep hound
#

Thanks. I forgot about that channel

runic parrot
#

Hi! does anyone know how to set a widget to keep the same size always when on "screen" mode?

#

Without Zoom

#

With Zoom

whole roost
#

on the character bp, how would i randomise the materials on the skeletal mesh? tryna find info on google but not much info, either materials or skeletal meshes

faint pasture
dawn gazelle
marble mesa
#

Hello, all. I started up a blank project to teach a buddy some UE4, but after creating a simple PlayerController subclass, BeginPlay is never called. I don't understand what I'm doing wrong, and i've been using UE4 for 5 years. What am I missing?

dawn gazelle
marble mesa
#

Yes

devout latch
# runic parrot Without Zoom

I had the same need a long time ago but then I realized it's an illusion. The widgets ARE actually the same size but when you zoom out of everything else, it appears to be bigger..but it's really the same size it's always been..

runic parrot
#

yeah, i just realized that. i'm gonna see if i can change it so it doesn't look so weird, maybe scale it down when zooming out

devout latch
whole roost
#

@faint pasturethanks, just need to figure out the replication part everyones got different to what they should be lol

marble mesa
#

Well, this issue has completely stopped my teaching my friend for now. LAME

devout latch
marble mesa
#

This is on UE 4.26.2, btw

devout latch
marble mesa
#

I did try it without out Parent: BeginPlay and nothing changed

trim matrix
#

In my MainMenuWidget, I have all the vertical boxes, and images, and buttons, etc there.

#

But when I go to the event graph I don't see the vertical box variable? Am I meant to? How would I set it to be visible or not?

spark steppe
#

you have to activate it in the details panel in the widget editor

#

select the vertical box, top right next to the name theres a checkbox

trim matrix
#

Ahh ok thank you!

dawn gazelle
marble mesa
#

Thank you! That is some seriously strange behavior, preventing BeginPlay is disastrous

dawn gazelle
#

GameState and GameMode have additional functionality built into them beyond GameModeBase and GameStateBase and they're meant to work together - it's something I"ve come across a few times and I thought of it as it really doesn't make any sense why your playercontroller wouldn't fire.

marble mesa
#

Thanks all the same! I'll add that quirk to my LONG list of UE4 "gotchas"

bold wasp
#

My blueprint for runtime foliage replacement works! But the "code" is so Fn ugly it triggers me. Does anyone have a recommendation for how to make things cleaner? Worth learning C++ for this purpose alone?

dawn gazelle
bold wasp
#

Oh ok yeah I was thinking was there a way to load data without lines, I guess I can use variables for that, thanks

rapid robin
#

Greetings folks o7

I want my pawn to rotate towards where its camera is pointing. But I want it to happen at a max speed, and ease into its new position. (so it feels smooth and a little laggy)

I have the camera's Forward Vector... Anyone have any cool ideas how to best wire this up?

rough cedar
#

Anyone know how to get character path movement along a spline to not be stuck to the spline? I noticed I’m losing a lot of the character movement functionality when I’m attached to it. Is the only way to move characters relative to a spline via local offsets?

earnest tangle
#

You can use the spline as a guide of sorts instead of attaching the character to it

#

As in, get points along the spline, and use them as targets for navigation based movement

woeful pelican
#

Thanks, made the modifier for the camera but I want it to use a dynamic material instance. Would this blow up?

earnest tangle
#

Try it and see :D

woeful pelican
#

:D

earnest tangle
#

I think that's how you'd do it though

rough cedar
#

@earnest tangle I tried something close to this using a tick and getting the location of the path follower as it follows the spline and then setting my characters location to those values it kicked out. Which worked but because it was on a tick it was a not very smooth. I like your idea of getting the points of the spline though! I’ll try that next. Although I did just get movement to look decent with offsets I’m open to trying any options right now.

How would I go about getting the info from a point on the spline?

woeful pelican
# earnest tangle Try it and see :D

So, I can set scalar parameter values and then retrieve it, but it doesn't seem to update the modifier. Weights are at 1.0 and I did test the material instance having a default value.

#

Print strings are as expected.

earnest tangle
#

@woeful pelican not 100% sure tbh. My project has something sorta like this but it just uses materials and changes the parameter on them to control the effect

woeful pelican
#

Do dynamic material instances work on just the material?

#

Thought it had to be Material > Material Instance > Dynamic Material Instance

earnest tangle
#

What do you mean? A dynamic material instance is a material instance which is a material

woeful pelican
#

I mean this

earnest tangle
#

Ahh

#

Yes, you can give it just a regular material - it probably wouldn't list them as choices if it didn't work :)

woeful pelican
#

Well I'm always sceptical if the smart context things are correct :)

earnest tangle
#

hehe

#

true, sometimes it is wrong :P

rough cedar
#

The problem I’m running into with a get location at distance method is that it needs a constant feed of that value updated. Which I think the only way to get that would be with a tick. But how can I get that new location to not be so stuttery as it updates?

earnest tangle
#

You could probably set it up so that the moving actor requests a new move target slightly before it reaches its destination

#

I think this should prevent it from being stuttery, as it should be moving when it updates to a new target, which would hopefully prevent it from stopping momentarily as it changes the destination

rough cedar
#

Ok thanks I’ll see what I can come up with!

chrome fractal
#

My gizmo is not at right angle it moves objects in two axis.
Can anyone know plz help.

earnest tangle
#

try clicking this to toggle between object and world orientation for the gizmo

chrome fractal
#

ok thanks

tight schooner
# bold wasp My blueprint for runtime foliage replacement works! But the "code" is so Fn ugly...

It helps to adopt a consistent style no matter what it is; putting getters & pure functions in a "logical" place relative to the executed nodes, and aligning the executed nodes in some linear fashion (keeping the boxes aligned or keeping the white wires straightened are the two major approaches). You can use reroute nodes to reduce the visual clutter of crisscrossing data lines. Collapsed graphs, macros and functions can also be organizational tools.

BP will always look like BP, but because it's visual, it's worth putting some effort into making your node graphs legible after you make them functional for the sake of your future self and/or collaborators.

wary tinsel
#

alternative way to get reference of a widget instead of using 'get all widgets of class'???

earnest tangle
#

kinda depends on what you're trying to do

#

but typically you'd get a ref to the widget's owner and access it through that or something along those lines

inland coyote
#

hey fellas, i've got a problem for some reason my animation BP is having an issue with casting?
though it all appears to be working just fine regardless.

my problem comes when trying to get this to sync online, and this is the only problem i've managed to find as 'this is a problem'

wary tinsel
#

mmm because I need to call an interface

#

I am wondering if maybe using event dispatcher would be better in this case

inland coyote
#

@wary tinsel i concur with what zomg said

wary tinsel
#

the problem is, when I package the game the hud reference is not working (is not calling the interface to display my score). If I respawn the player then it starts working

#

so I was looking for alternative way to get this reference

inland coyote
#

you could potentially 'pre-kill' a player to force it to work as a workaround

#

not the cleanest solution, but might help debug

tough burrow
#

So you can read it from anywhere

wary tinsel
#

yep I was about to try this...thanks dude!

tough burrow
#

Let me know how it works out πŸ˜„

dim robin
#

how can I show actors on render target (scene capture 2d) AFTER spawning? I can't select those actor on the "show only" list.. daaaaamn

wary tinsel
tough burrow
wary tinsel
#

I spawn it from the player controller

tough burrow
#

Without the reverence

wary tinsel
#

yes I do of course

tough burrow
#

Ok, can you try "Get all actors of class"?

#

And set HUD reference that way

wary tinsel
#

that works fine but not in the packaged version idk why

#

and if I respawn the player, it starts working

dim robin
# tough burrow gimme a sec

on this "show only actors" array I'm able only to select actors ALREADY present on the level. I need to add my pawn actor also to be visible, but the thing is that is not spawned until the start of the level, so it will not work.

#

I would like try the opposite also, by show everything first and then exclude every actors in the scene except the 2 i need to reveal. But I have no idea on how to tell to blueprint to "get all the actors in the scene"

tough burrow
#

And not components

dim robin
tough burrow
wary tinsel
#

nope i try it now

wary tinsel
#

maybe I should use an event dispatcher, should not be heavy in terms of performance if it only calls one function right?

tough burrow
#

Are you sure it is the reference problem then?
Since you force the reference to be set

wary tinsel
#

I guess so because I tried many things before this. and I found out the problem was the reference

#

but you know...I may be wrong of course

#

in the editor/standalone it works fine

tough burrow
#

Can you try printing the reference after the part of code I gave you?

wary tinsel
#

this is what giving me pain

tough burrow
#

Print string that is

earnest tangle
#

so let me see if I understand this... you want to get a reference to the HUD at the start of the game, but it's failing if the player pawn is not spawned yet?

wary tinsel
#

I need a reference to the start of the game (in my pawn) because I need to call some dynamic event on my widget (like score and stuff like that). To make this I did an interface an so far so good. It's working fine in the editor and in the standalone

earnest tangle
#

Try doing it in in the possessed event of the pawn

wary tinsel
#

when I package the game I start playing and I can't see these dynamic events. If I respawn the player it starts working

earnest tangle
#

At that point the player controller exists which manages the HUD mostly afaik

dim robin
#

if i understood the problem you need to do this after the player possession, otherwise i think it won't work

earnest tangle
#

hence using possessed where it should work I think :)

wary tinsel
#

I thought that too ( I set my player as default pawn class)

#

so I tried to spawn the player, possess and set the reference but still nothing 😦

earnest tangle
#

there is a possessed event in the pawn

#

similar to begin play and such

#

if you need to do the logic in the pawn, that's where you could try doing it... not sure if you did it there specifically

#

additionally - in your GameMode there's a function called PostLogin which you can override

#

the HUD should exist at that point

#

(it gets created before PostLogin is called)

wary tinsel
earnest tangle
#

How did you create it there?

wary tinsel
#

with get all widgets of class

earnest tangle
#

Where does the widget actually get created?

wary tinsel
#

in the p controller

earnest tangle
#

where in there?

wary tinsel
#

on the begin play

paper galleon
wary tinsel
#

I guess the player it's spawning first?

earnest tangle
#

Hmm, I wonder if the controller BeginPlay is guaranteed to run before the pawn gets possessed

paper galleon
#

I think it is.

#

He should show code. And get all "something" of class is really suspect to me. I hate using such nodes.

#

It doesn't scale well when you have multiple objects of that class

wary tinsel
wary tinsel
paper galleon
#

Just show your code. Makes it easier to diagnose the problem

wary tinsel
#

ok I managed...I put a delay after event possessed to see if the suspect was real

#

and yes probably it wasn't working because it was running before

#

thank you so much guys for helping me πŸ˜„

earnest tangle
#

Yeah so I guess possess isn't guaranteed to run before beginplay for the controller then

dim robin
#

is there a way to get ALL the actors (no matter the class) from the level and make an array with them (since they would be different classes?)

earnest tangle
#

what you could do is you could create the widget in your player controller's possess function instead of beginplay

#

this should make it available during possession in the pawn

wary tinsel
#

thanks dude

#

because these stuff become a nightmare when you package the game

earnest tangle
#

Yeah

#

You can often "solve" these with delays... but that tends to just lead to things randomly breaking because the timings were a little bit off for one reason or other lul

#

so if there's another way where you can guarantee the order of execution it's usually better

wary tinsel
#

better work on events of course

maiden wadi
#

I actually found an honest use for Delays. Bindings that can run many times in a frame, causes hitching when UI updates. Is better to delay it to the next frame with a 0 delay, then update there. Causes UI to only update once. Rather effective.

earnest tangle
#

Yeah I was actually using it for that as well in one place

#

basically a debounce