#blueprint
402296 messages · Page 834 of 403
So I have color tired to each slot in my inventory based on a value in the weapon
and im struggling to figure a way to do this would making a get text and Get color for Each dam slot in the invnetory
Made a map earlier in the weapon get return color based on the weapon tier
but not binding a function to each slot in my inventory for color escapes me
I dont wanna spaghettis code anymore
btw ignore the - 0 that's not important
Also for my function that sets the text color and name when I stand over an Item, I want that in the sword if possible but also not sure
If you need to, sure.
Are you saying you're trying to avoid using binds for the color?
I would need to make a bind for each text box in my inventory
if that is that way so be it but it seems like spaghetti
Definitely not. Each slot should be it's own widget.
🤔
You're representing an array of items. What better way to represent them than with an array of widgets?
im guessing thats true, not sure how to use / make an array of widget
or UI element in general
@dawn gazelle It almost works, like I tried with day = 2 min and night = 1 min and after 2 min it precisly arrive at 11Pm but for the night it arrives at 1 min at 7:30 instead of 6:00
if something subscribes do an event dispatcher, and i delete that object, i guess the engine takes care of removing the object from the dispatch listener?!
Just create a brand new widget class that is for your inventory items - it should contain all the widget parts you need to represent your items (so like a button it looks like, a text field for the name etc.). Then loop through your inventory, create a widget for each item of the inventory. More complex would be to have the OnConstruct of the inventory item widgets bind to an event dispatcher that you call so they can update themselves whenever the inventory changes.
I missed to connect this branch now it stops at 11PM, how do I make continue ?
Needs a call to StartNightTime
is that blueprint in the inventory UI widget or the player
It would be in the inventory UI widget.
It keeps staying at 11PM
That one would need a call to StartdayTime
Also, those shouldn't be RPCs to the server.
Otherwise, you're letting the client tell the server when day/night starts and stops 😛
the events are on server
but why would your clients call to the server to tell them to start?
the server should already be running them without input from clients.
I don't see why you're telling the client are the ones calling the timer to start ? 🤔
Also it works perfectly now, so Thank you so much 😄 You stopped my 3 weeks struggle 😄 Could you tell me why your code works and not mine please so I can learn what not to do next time ? 🙂
@dawn gazelle Can I save your name if one day my game is released so I can give you a key for free and maybe some cosmetics (if I do them) ? 🙂
idk if datura is immortal
Subtle burn, love it.
Creating the index pin on Widget creation
When a node says "replicated to server" that usually means that you're getting a client to tell the server to do something. So if this code is ever run on the client side, and the client is capable of calling the RPC, then the server will execute that command. Based on your naming convention, I imagine this is on the game state, in which case, the client can't RPC to it, so it's a moot issue, but then that also means this event doesn't need to be set to "Run On Server".
As for why my code works and yours wasn't, it's likely just a matter of I separated out the logical flows and I wasn't restarting the timer every time the timer ticked, however, I don't know exactly why as for the most part what you had seemed like it would work, but it just wasn't working. You did have the right math for figuring out the ratios correctly which was good.
As for saving my name, feel free. lol
Yes, this has yet to be poven. We'll see eventually.
Yea, you can expose variables on classes that makes pins show up when you're creating or spawning them by clicking these options on the class. Once done, hit compile on the class, then on the spawn node you may need to right-click and refresh it.
But how do you make it not "Replicated to Server" because the "Day Time Start" is on server side 🤔
see ?
Also those prints don't show up somehow 🤔
I dont see anything like that in the Widget I made to change
also tried to bring up this but it shows no details
The part I can think to click is the inventory slot in the Hierarchy
The hint is that you're changing the "Replicates" property on the event. Replication is meant as a means of communication between the client and server or the server and clients.
By default, the basic classes like Game Mode, Game State, Playerstate, Playercontrollers.... They are all spawned on the server and replicate to the client (depending on the class of course, game mode doesn't do this).
This means the "Begin Play" that you see in the class both executes on the server and on the client's version of it. In this example,
If you want something to only ever execute on the server side, you can use the HasAuthority node.
This works because Begin Play fires on both the server's version and the client's version of this class.
There's no need for the client to call to the server to tell the server to execute anything. So if you put your timer logic on the "Authority" path from begin play then it would only start up on the server side, which is likely what you want to do anyway as you'd want your server to control the time, not necessary allow the clients to control their own time.
Go to where you define variables, create a variable for InventoryIndex and set those options on it.
But still it doesn't printstring both of the stuff in those events
Are you running as listen server or dedicated server (play as client)?
listen
Hmm... not sure what to tell ya... The events shouldn't be marked as run on server at all, but if you're running StartDayTime which in turn is calling DayTimeStart (may want to change these names around a bit to avoid confusion, I just named them whatever), then the print string should be functioning just fine.
@dawn gazelle One more thing. should I run this on event play. im thinking
OnConstruct
for the inventory UI?
Yep
hmm
This shouldn't be Server sided ?
dont see a construct for it
"Executes on Server" does not mean it's server sided. That means that you're exposing the event to allow clients to call RPCs on it so the clients can tell servers to do something.
Heu ... Are you sure about that ?
The events would run on the server but you don't need to mark every event that you want running on the server as "Run On Server" - if you do you will run into TONS of problems.
Then why it's there ? 🤔
I just explained that.
That means that you're exposing the event to allow clients to call RPCs on it so the clients can tell servers to do something.
Say I'm a client and I want to tell the server "I choose color blue"
I need to mark an event as "Run On Server" so I can tell the server my choice.
So by default everything runs on server then ?
is there a way to FInterp a float without having to make always make a separate variable for it?
No. It depends on the execution path you're on and if that object actually exists on the server.
(i dont like seeing them in my variable list)
I set those event to "Not Replicated" now and it still doesn't print on the client neither the server
but it prints in the output Log 🤔
Have you tried restarting Unreal? 😛
Let me do that
There needs to be some variable that is getting changed somewhere in order for you to interp it as you'd have to set it afterwards, no?
yeah,
but is there like a node or something that automatically tracks a pin's value over time instead having to create one of those myself?
like, I still like the simplicity of using select, but I just wish the transition wasnt instantaneous (since it's a bool)
Just restarted still don't see any prints
Ah I see... Sadly that's the entire point of variables. I can understand why you wouldn't necessarily want one for here, but what are you using this value for?
Not sure mah dude.. Put breakpoints on nodes (select the nodes in question and press F9) and you can step through where it may be failing.
If the print string node is firing but you're not seeing prints, that's beyond what I can help with.
I tried to print from the HUD same thing it doesn't show up that means maybe I pressed something disabling the prints on the screen
Does anyone know why this doesn't add my BP_Zone to one of the array depending on the index I give it please ? I need to add the BP_Zone actor to one of the array in the Game Mode depending on the dropdown list named "Trigger Details Task"
You need to apply the physics forces on tick rather than using LaunchCharacter
What could possibly be stopping this from working? I'm getting "Cast Failed"
you're trying to cast a save game object to (presumably) a player character
No that cast is to the save file "S_TwitchPlayer".
what is "S_TwitchPlayer"?
how do I clear the Play In Editor log?
How would I go about doing that?
I found a forum post from 2015 that said right click -> clear log but I get no menu on right click
google can assist you with that
if you press F8 that's a shortcut for putting down a single breakpoint
found it, needed to go to right click in output log instead of message log
made a compass for my rpg game and i wanted to display enemies on it. I only have one image which is the enemy tracker so the problem im having is that if there are multiple enemies, the compass only displays one enemy as there is only one image. bare in mind that the enemies all share the same bp, they are just dupes of each other. How would i make it so it displays all the enemies using that one image
thats what i have right now
just testing the arrays that why there are 2 but will change after a fix has been found
Delays in a For Each Loop is a big no
i done it for performance, ill delete it
It will just break the entire thing
Use a Timer
And no reason having 2 GetActorsOfClass of the same Class
i used self array at first
but tested all actors of class to see if the self array was not working
make array and casted it to self***
So I redid my inventory with some help form some people in here but now Im using the Inventory slot I made (picture 2) based on the index I created in a box in my inventory And for some reason if I try to populate the text slot in the slot I made it wont work, Ive just returned simple strings and that worked just fine so idk why this is happening
That part feels totally unnecessary if you're storing just your Location before doing anything
pic 1 is the construct of the inventory made of slots
had it like this before but dont i need an array instead of just target self as then it will only get one Ai
or am i wrong?
Is that to get your Location?
Cause that will get your Location
And tidy it up
Do this or directly use the Player variable
no its to get the enemies location
Why
because the variable is created in the player bp
this code works and tracks 1 ai
if i duplicate the ai, it doesnt track it
only tracks the first ai
But doing that gets your location, not the enemy location
nah
Yup
im getting the variable which is in the player bp
and storing the enemies location inside the variable
the connection doesnt conflict with the location
What variable 🤔
So you want to get each enemy location and store it in the Location variable, alright
Seems a little weird that a Widget is getting the enemy locations and setting it into the Character tho
and right now the only reason i can think of is that there is one image on the compass which is the enemy tracker image and unreal cant duplicate the image onto another enemy
There's only 1 cause the Location is only 1
It's not an Array
That holds all the Locations
Not sure what you use that variable or how you use it, but in your case it would look something like:
Clear Enemy Tracker Array -> Get All Actors By Class -> Get Actor Location -> Add to Enemy Tracker Array -> Show Locations with a For Each Loop of Enemy Tracker
Nope
well then
And you can use this to Add to the Array
Like that you'll have an Array of all enemy locations
If you want the Radar to locate enemies every 5 seconds or so, just create a Timer as i said
Depends what you are doing
this is for the compass, getting the locations on event tick
enemy locations, objects around the map etc
Depends how fast you need the locations
preferable constant
What's the node to enable a box collision's collision or just enable / disable the actor containing the box collision ?
iv added a 0.5 delay on all
It won't work
so its not every frame
Delays on Tick don't work
it works
oh
but
doesnt it trigger the delay every tick
so it will trigger a 0.5 delay which will cause the code to be called 0.5 secs within the frame slower
I mean, even if it works, you're far better with a Timer most of the times, they're done for that exact specific need
I never used it like that myself, seems highly unnecessary tho
Just do yourself a favor and switch to a Timer :p
how do i show the locations with a for each loop of enemy tracker
if player is within 3000 distance of enemy is sets the tracker visible
this is what i got with ur code so far
Well, do you manually create the Markers or Procedurally?
Cause you would need to Procedurally create one marker for each Enemy in range
And assing its location
manually i think, wait i can show you
Yeah that won't do it, what if i have 10 enemies? Having just 1 marker will do nothing
Number of markers needs to match number of enemies
Set Collision Enabled?
Use OnBeginOverlap for the trigger doesn't print anything even if I have a print string there
Yeah no, that won't do it, you have just 1 marker
i guessed that was the issue, would i need multiple markers then?
For sure
Array still holds 100 elements in that case
so how and where would i call the additional markers
You need to create them based on number of enemies visible
ill do it tomorrow
imma go bed my brain hurts
thanks for the help bro much appreciated
It's a complicated system, probs approaching it in a different way may help, just seems a lil weird how it's done rn :p
Nah, it's surely not that
thats how i normally do it
He's getting the Display Name of the Actor that Overlaps
So it should return any Actor that Overlaps
still doesn't work
click on ur box
Did you fiddle with the Box in any way? Is Generate Overlap Events ticked?
What are you trying to Overlap?
the player
this should work.
You can just make the Print Non Development Only
Bruh
Blueprint, you decide which one
Last one works in a packaged build
It's a keybind or you can enable it to show in the menu
so any idea on why it doesn't print ?
How is your Pawn collision looking?
Allow Explicit Impure Node Disabling in Editor Preferences
Ticking that only makes it show on the Right Click
I see nothing wrong from what you sent, you sure you actually overlapping it? Try making the box bigger
100% sure as I have it visible in game
You sure you didn't disable stats for some reason?
stats ?
Hm, honestly out of ideas, it all looks okay
Perhaps try creating a new blueprint with just a box and see if it acts the same
If it works, it's something with the Box BP, if not it's something with the Char BP
it works with a new trigger
So something borked with the Box BP
You could try recreating the Box inside the BP, see if it fixes
Now it works, WTF ?
These last days I have weird bugs like this
How would you get a key for an input action but not on the event? I want to use it for showing an Interact Prompt.
I feel that, lol
Is the 4.26 this bugged ?
Never had that problem, but had no sense problems where the fix was just recreating the thing, so i just feel the pain
snif, like few hours ago I had another bug with print string not showning up on screen but after sometime it came back
Unlike my dad :D
bruh
You may need to use bUseLoggingInShipping = true
Should be in the Target
Yeah, pretty sure UE disables+ logging into Shipping by default, you can still have it by doing setting the Print to Always and having that bool in your Target
The Target thing is a must tho
Atleast now you can easily disable / have development only nodes :)
I always find this cool
Hi, I want my character to be able to walk through wallls temporarily after a pick-up. I found info about object channels, but can't seem to find out how I can change it for a few seconds. Does anyone know a good way to do this?
I was thinking about making the walls a certain object type and have my character ignore it. But haven't found out how to do that yet.
Nevermind, I'll think I get there eventually xD
You can just have a custom object channel and change how the Pawn responds to it based on the Pickup for example
Now you'll have it in the Collision responses
When you get the pickup, you can do this in your Character
Just call the channel Walls though.
I'm trying it right now haha
Oh yeah, i think i know what
It looks like it is working though 😉
Ye I already had that, but my issue was that I didnt know of the Set Collision Response to Channel node haha
So it is working now! Thank you very much!
Aye! Good to hear
how do i make an array that calls an event based on selected number when selected?
left mouse > selected number > event
the event will change based on a number
awesome, thanks :)
hi. does there is any way to change actors FGenericTeamId? for using detect enemy and friend in ai perception
and then just add pins that call the event?
have the integer be updated seperately
i have the number start at 0
q + e do -1 and + 1 respectively
then it loops back round to 10 or back to 1
ah
so, if the int is 4, it'll call the 4th output pin? im a little confused
awesome
i shall work on that when im no longer lazy
and then ill just make it so whenever the event is called it sets the int back to 1
awesome. thanks mate you're a huge help :)
You don't. You branch your logic based on selected number. What are you trying to do exactly? This sounds like something that probably has a better implementation depending on your use case.
Oh. I didn't realize that was the same conversation. Name change. 😄
hey guys
I have the following functions that each set up one of those bools. I needed them, because I want to change some thing based on the angle. For example when it's at a 90-80 angle certain things happen, on a 80-70 angle other things and so on.
For example look what happens when its between 90-80:
but I want to make it so that each of them calls a new function. for example if 90-80 is true it does X, if 80-70 is true it does Y, if 70-60 is true it does Z and so on
is there an elegant solution to this ? Should I change the bools to integers like and call a switch on int ?
the more I wrote the more i realized I need to change the bool setter to an integer setter and do a switch on int
xD
That is some weird functions
Sounds like you want a macro
In < 10 then 0-10
In < 20 then 10-20.. etc
yeah but I dont know how to make them
Macros?
Jeez that's a lot of booleans. If they're mutually exclusive then it could be an enumerator. Or you could make a single pure function that does the check and outputs an int that you can use a Switch On node with, or... Lots of other ways to set it up
A macro is like a collapsed graph that you can reuse
It can have multiple exec pins and... There aren't many restrictions
in the end I did this :
instead of a 9 bools i made a single int setter
and i change it 9,8,7,6,...1
and i call it with a switch on int
but as you guys said, im looking into the macro thing also atm
wow
invert the intial check so we can connect default on the switch aswell
just for good measure
guess it was ugly regardless
gosh ... 😄
what in the world would you want to react to every 10 degree in 180 degree range....
oh
:))
here this is better
the thingy can only turn between 90 and-90 (so it cant turn facing upslope)
so based on the turn rate i want to set a few things, like friction etc
the strenght from the physics truster
You can always take the floating point angle and divide it, round it or truncate it if you want to quantize it into an integer
If you want the quantization
Sounds like a better way of doing it
atm i just had it to between 90 and -90 the physics truster is at a large value and the friction is very low, at 91 or -91 the truster goes to 0 and the friction increases over a few seconds, so it mimics a break / stop (picture a ski guy going down a hill)
figure out the math you need for your parameters
and convert the angle to the correct value
Or you can drive the parameters directly with the float value by... Yeah.
Sounds like dot product could be the magnitude of friction basevalue etc
your options are much more elegant than mine
Imagine this when you want to adjust the friction in general
you'll need to change it on every single possible angle...
very much extra work imo 😛
If you want the response curves to be nonlinear, you can make a curve asset and have the float angle sample your custom curve
Lots of better ways to do it than branch execution in 20 directions
Yeah I knew for sure there must be other ways
but I didnt really know how - still dont, but i`m looking into it as we speak
I`m loving this - there are so many ways to achieving the same thing, more or less, some much more elegant than others
this works 😄
yepp 😛
hmm except the minus part
its not returning anything when its on turned "to the right" aka on the minus part
any ideas how I could do this?
yeah the macro seems the middle ground
i've no idea about how to use the curve, and for what little i need it, the macro seems "good enough". but i cant figure it out how to do it on the minus
Do you want it to output the same pins for left and right? Or should it be a separate set of pins?
oh wait, I was behind
how its outputing now is fine
but the minus part isnt working
so i can know when its between 90 and 80 or between 80 and 70 or 70 and 60 but not when its between -90 and -80 .. and so on
The int going into the switch would be negative numbers in that case, so you need to set the switch to start in the negatives and add those to the outputs of the macro too
This might help if you want to go with curves https://youtu.be/QrgjRjpu9k0
What are the Get Curve Value Nodes in Unreal Engine 4.
Source Files: https://github.com/MWadstein/wtf-hdi-files
thanks ill check this out right now
If they do the same thing
you can just ABS the input float
as in
if -10 and + 10 is gonna have the same friction
goddamn i asked for help for an issue and then I learned 4 new things from you guys (well, 3 cause i`m still on the curve part). at the moment ill use the macro with the ABS its working super fine 😄 but i'm also learning about the curve I think it will help me a lot along the way. i love you guys
ok so from what i understand now
the best way to do what I need (or well, the best so far) is making a curve to drive friction and the physics truster, so for example if its closer to 90 or -90 the bigger the friction the lower the truster
assuming you update actor rotation when moving
dot will be 1 if the directions match
0 at 90 degrees
and negative when more 😄
So you could say Friction = BaseFriction * Max(0,dot(ActorForward, WorldForward))
Currently working on a making a Fortnite clone to learn more about unreal engine.
I would like tips on how let the buildings know they dont have any support anymore and need to get destroyed.
So they dont fly in the air when i destroy the buildings underneath them.
I haven't found anything on the internet about this just yet / dont know how to word the question.
looking into it now
You can keep references to the attached structures
since it's all very grid based
ye but what if i place a new actor next to it then is connected to the ground and the old one gets destroyed
You add a new reference...?
Something like this
You would know whenever you have a new thing connected, as you need to know for the grid to work as well
wow just wow
1 silly question what is the world forward, where do i set it from
"assuming you update actor rotation when moving"
this?
Assuming you got fixed camera rotation
yeah camera isnt rotating at all
down
more or less
so in this scenario the red wall should be have a reference to the green one?
towards
If you're alligned to the world then -1.0 in X is "world forward"
i'd probably use the camera forward instead but might need to align it with the actor first..
The green wall would know it's connected to the ground, the blue would know it's connected to green and red would know it's connected to blue
That way, when blue get's destroyed: red will know one of it's supporting structures is gone, if none are left it also gets destroyed
if you would only store green as reference, destroying blue wouldn't do anything and you would have a floating red structure
something like this
❤️
if i place these afterwards and destroy the green one then the blue one would get destroyed even tho the gray one is connected to the ground how would i prevent this
Not really because now blue has 2 supporting structures, red and green
The moment you connect lightblue here, you would need to update all linked ones
Which isn't too hard since red knows about blue, blue knows about green (and you would need to know about red to be able to connect them)
you might need to normalize the players rotation in the same manner
im having a go at it now
I would have the friction update on tick (or on player rot update but prob input axis so tick anyways)
its actually on the input axis
wait im trying to have a go at it and i want to show the results 😄
so if i place them in this order gray should tell purple It is an Ground structure and can support it?
and should purple tell light blue gray is a support structure?
when 6 hits ground, you backpropagate support value in reverse is what i'd think
assuming 1 can already support 5 ..
Yeah like Squize is saying... the moment you place 6, you would go down the list and tell 5: 6 now supports you, 5 tells 4 to add 5 as a support and continue through the whole list
but when i place 5 5 will think its supported by 4 and 6. so if 3 and 6 break they will still think they support each other right?
i think i need some way for 4 to be able to go down the connections and check if anything is connected to the ground but that would probably be really intesive for every build
I havnt done this setup before, but i imagine the beams holds a support value
or rather 2 values really
one value that is set if they are touching ground
and one value they get from surrounding structures
with some decreasing logic ..
based on their own type, and their placement relative to surrounding constructs...
is this some sort of physics setup?
yeah no reale physics
fortnite build system logic
ah I see
same as fortnite it needs 1 piece to connect to the ground or base wall rest can fly
isn't it just building a tree structure and if any of the root nodes collapse the leaf nodes of said root nodes collapse as well?
Does that work if a leaf is connected to multple roots ?
you wouldn't have a leaf node connected to multiple roots
a leaf node can only ever have one root
otherwise its not a leaf
that wouldnt work then
how come?
Imagine setting up two beams and a platform
because 1 object can have 2 roots
platform on top of the two beams have 2 roots
if 1 breaks it should still fly
the object collapses after 1 beam collapses... makes sense?
ye
okay so it's a graph
so it would still hold with only 1 beam
yes
Yepp, it is a graph
each object holds a map of connections TMap<Object, EdgeWeight>
new terminology for me, but it appears correct
then just have a delegate that triggers any time the structure changes (e.g. called on actor destroyed)
that could work maybe
it's the simplest way of doing this
in a manageable fashion
edgeweights are optional
but could be used as a heuristic
i would make it a bool i think
the Edgeweight
so if it i connected to thte ground it would be true then if an actor gets destroyed i would update surrounding actor and say its not connected to ground
and make the actor check if they have any other connection to ground if not make them destroy themselves
well you'd have to have a "grounded" as a special case
but equally that could be part of the edgeweight as well
yes something like that
im gonna go have lunch il be back in a bit and try out that idea
and then on spawn you'd have to ensure that you know which object you are constructing off of
yes connection check
I'm working on a bp tool that renames my assets in the world outliner to it's proper asset name. But I can't figure out how I can get the original static mesh name. Right now I just do a regular input from the user, but I want to skip this step and just have it fetch the real name. Is there any specific get function for this? Feels like I've tried most of them with 0 success 😅
I think you may have to Get Static mesh Component>Get Static mesh>Get Name
aah sorry, should probably have mentioned that the tool is editor utility blueprint. So I don't have that one
it should be? I only select static meshes with the get selected actors that creates the array.
I think you are close, Can you pull off the Array Element pin and "Get Static Mesh" ?
ahh, is the Get Selected Actors returning Actors ?
I can't do that. If I uncheck context sens I can see it, but I can't hook them together
yes
toss a [Get Component by Class] Node in there
That will loop thru actors and get the First Static mesh it finds in each actor
make sure you set the Component Class to Static Mesh Component
Hello! I would like some guidance/starting point of making a game mechanic using tether and chain-like In Knuckles Chaotix (reference gifs) and tied together but in 3D in UE4, for local multiplayer. I want the tether mechanics to behave like a rubber band and must be used to maneuver the characters on the level. Are there any tutorials or anything to help me do this part? I already set up the local multiplayer. Many thanks
all the different get name only gives me "staticMeshComponent" and not the actual name of the asset
I imagine it would be adding force depending on the difference in speed towards the other character
Which would automatically force this rubber banding behavior if tweaked correctly
Get static mesh , from the found component
this didn't work >?
Oh , thats what you already said, mb 😄
i think it was covered by my tooltip text
thanks
np
ooooh yeah that makes sense, do you know I can start implementing that in the third person blueprint and creating a tether and chain mesh
The character by default supports physics interaction so yes 🙂
Sorry, Where can I apply that? especially attaching to a different player too
You probably should create a new actor that gets 2 references (2 players to attach) and applies these forces
<@&213101288538374145>
:no_entry_sign: Rishabh#2723 was banned.
I feel like I'm having trouble with a simple problem
I have Actor1 location: Vector3
I have a parameter for Actor2 Offset: Vector3
The actors are separate from each other, I want to position Actor2 at the same position as Actor1, then add the offset value, but only in the forward direction of Actor1, not the world direction.
How do I take the info I have on Actor1, and convert the offset to a value rotated relative to the forward direction of Actor1?
I'm rotating Actor2 to match Actor1's forward direction too, so I can do the offset locally after the rotation but would be nice to do this all in 1 step
Hello! I want to create a modular radial menu to be navigated by using the Thumbstick from a Gamepad. My quenstion is, how can I translate the thumbstick vectors (Forward -1 to 1, Right -1 to 1) to the right position of my divided radial menu?
You can get the Actor Forward Vector of actor 1 and multiply it at your will (let's say 500) to a value and then add the actor 1 world position and set all of it to Actor 2
multiplying the forward vector of actor 1 will give you the offset, and the world position set the world coordinate relative to actor 1, I think it's what you want.
hello everyone. So i made this condition and on true i want to move the character to a position. But how do i do that? I ve been trying diferent things as simple move etc.
Hi what is better to use performance-wise, multiple static meshes or spline with spline meshes?
Hello, I can make Soft Level Reference Var type: World, but I can't make a map with value "World" I can't find this type.
anyone have any ideas how to make map with value: "World" (Level) ?
yeah there is no way outside of c++ afaik
hello how large is it recommend for game save files to be before they start bugging out? is having 10mb save files ok?
Anyone got an idea on how you would go about getting a random location in front of an actor at a defined radius?
I would do
You do this the same way that you would with a mouse. Screen Space is all 2D vectors. If you construct a Vector2D from your two axis, you can get a direction from them. How you math that out is up to you.
make a 2d vector from the input, then get a direction, then rotation, then compare value
or you can use 2d dot then compare value
My very limited testing shows major costs with splinemeshes ...
nice thanks a ton
So either static or instanced static meshes
that didnt work
this is what i made. and now i wanna move the actor. how do i do that?
Input in level bp...
that just for a test.
Some things should not be allowed 😄
can you just not be stupid. it better stay quiet than talk like this.
Worked for the most part though it doesn't set the location in front of the actor.
Im fine being stupid if it keeps people from using input in the level bp. Not sure if you can enable input in the level bp, but could be worth a shot
it should work by default but justincase
you can check if the input event is working
it worked.
but i want to know how can i move a actor because i tried with ai move to, simple move to. and with custom event
Level BP does receive input
You showed none of your implementation
Not shocked, but sad to hear this
Yeah
thx
@maiden wadi @remote meteor Ty, I'll look into that.
it still not working
i made this and now i wanna move character close to the cilinder when its true. How do i do that?
so why is it a great crime to handle input in a level class
Tons of ways to do it. Id suggest following some tuts to get familiar with it. Anything from SimpleMoveTo to custom interps
like there's no hesitation to tell someone they're stupid or doing something wrong
but holy fuck nobody can actually explain why that's bad
what if you have a control that only is relevant in a level?
i ve made with simple move to and didnt work. and creaTE A custom event and didnt work to.
@hollow inlet if your control is only relevant in one level and will never be used for anything else then it seems not entirely terrible to have it in level bp
assuming it's otherwise easy to implement and you don't need to do any weird stuff to accomodate it
seems not particularly awful to me, either
Chances are that its still not relevant to the level, but to some actor in that specific level
you can use in level bp but this will make that everything on the level when you press the key will do that interaction. but only in the level so if is just for level its okay
@gentle urchin perhaps, but it's not a huge difference to implement it one way or another. Even if it was actor specific, you might need a level specific subclass of the actor
Surely we can always create a scenario where this is a valid approach :p
The main downside in putting the logic into your level is if you decide to change your level structure now you have to deal with moving the logic out of it
point being, if you can take the time to type out your criticisms of newbies, maybe you could take the time to type out WHY you think it's so evil
So that's why architecturally it might be better to put it into an actual class of some other type
In a multi-person team level changes are also somewhat annoying to manage on a version control system, because it's a binary file and the UE editor often updates it even if you don't change anything
This is another reason why it may be beneficial to consider placing logic somewhere else
it doesn't matter
You asked for examples, I'm giving you some
If we already lost him, whats there to explain lol
you're toxic, you suck at giving help, maybe you could rethink your approach for the next one
the point is to make you feel bad for being shitty to newbies
Toxic? Lol
I've definitely noticed that some people are really fucking snarky sometimes
That is true^ 😅
But I have no idea who this particular issue is referring to
Then you're not paying much attention
All I see is Squize saying he's disappointed that level bp receives input
Theres plenty of very helpfull people
I'm not really sure what else I'm supposed to be looking at :P
What's the problem with that?
Apparently its toxic
Frankly it seems like a misunderstanding
anyways forget about that. I know thers something that verify if a input key is pressed. How do i check if a key is pressed?
Isn't there like a key pressed or key down node or something like that
i will check.
to move a character that is being controlled my player i need to disable input before move it?
Depends on how you're moving it
Ai controller and navpath might be essiest,
And as suggested before, top down template has a good example
follow the top down template
ok
"Is input key down"...also enhanced input in 4.27 has methods
like this? @gentle urchin
Not on tick
You only need to call it once,
Pathfollowingcomp handles the rest
Cant recall if it needs an ai controller tho(?)
And a navpath , if you dont have that
should work with a player controller
Can I store selected asset class to an array with Editor Utility Widget?
in the top down example, its called in a player controller
there's a "iskeydown" node on the player controller
if you just want to get a bool for some checks
sure, you can probably set things to an array from anywhere
Am I the only one facing this bug :
- Create an Actor BP, inside it put a Box Collision
- Use the Beginoverlap event and cast that to the player character and print the character display name on that
- Test to see if it works
- In the construction script put a "Set Collision Enabled" and link it to the Box collision and set it to "No Collision" in the Set collision enabled node.
- Test it (it should not print anymore)
- Now Disable the Set Collision Enabled node in the construction script and you will see it still doesn't work somehow
Am I missing something ? I'm using 4.26 version
Not sure i understood thd problem?
If you disable collision the expected result would be no collision
The trigger detection doesn't work anymore after the doing the step above I have to delete the trigger and add a new one
yeah but after removing that node it stays with no collision still
Unless you remove and add the actor, right ?
yeah
So you've succesfully manipulated an instance's collision setting
It's because construction scripts run in editor mode also..have you tried restarting after removing it?
If you need to manipulate collision you'd probably want to do it on beginplay
but why does it create this problem ?
No need to restart, just removing it and putting a new one makes it work again but it's a weird behaviour
But is it a problem? Sounds like expected behaviour
Because you changed the collision then removed it...if you set it in the construction script to go back to its original state before removing it does it still present the error?
As pointed out, its ran at editor time
yes
but removing the SetCollisionEnabled node doesn't give the normal behaviour either so that's why it makes no sense
Hmm. Well i guess thats a tad weird, if enabling it on construct doesnt update the instance collision again
Removing it doesnt update it tho
Removing the node it doesn't update it, but removing the box collision and put a new one fixes it
You would have to nudge the actor in the scene to force an update
I nudged the actor in the scene and it's working for that actor but not all the other ones already in the scene
Yeah it sounds like it's working how construction script is intended... Little quirks like this is the reason why I try to avoid construction script unless absolutely necessary
You would have to nudge them all by the way
You can however
Make an editor function for this
If you want to edit it on the fly like that )
:)
There are other ways to force an update with the construction script as well just make a minor little change and change back something in the view of the actors scene
That should force an update on all place actors too
but you do have a nav volume, right?
Like I need those box collision to be disabled by default and I need to enable them at certain time, how do I do that ?
yes
Depending on whether something's going to trigger it... You probably want to start with the collision disabled on the box
how ?
how ?
I have an array of recipes. When every time I load the Crafting Menu. It wants to add 1 more of the same item,
Because if you start with it enabled even on begin play there's a chance it will be triggered by something that could possibly trigger it before it has a chance to disable
if you press P, is it all green?
anyone have an idea
Disable it in the class itself, and enable it on your criteria
But I don't find where to disable it in the class
For an editior function just make a custom event ,
Click the collision box in the components panel of the actor class that you're working in
And in the details panel, mark it as "call in editor"
Then as squize said its in the details panel for that component
Then make a instance editable bool (and possibly collision setting) and use that as the new values for the collision setting altered by that custom event
Sounds like ur recreating the crafting list without clearing it first
See I tried using something like this
and that doesn't seem to work. It does clear the list. Then i can't get the list to show again
ok
You want to remove them before adding the new ones
I don't see how I can do that. sense The button is on another widget to create the list. and the list is created every time the widget gets loaded.
i already solve the problem thx. Now, i want to make some combos on combat, and i have left and right punch. but when i pressed left mouse(punch button) he just do right mouse punch coz it skipped the left punch. I want to know how can i check if a anim has been played and only after that if i pressed left mouse the right punch will be played.
On construct, clear list right before you populate it
this is the list it makes
If thats the event ur using
I found notifystates being helpfull for this
Got it working. Thanks I just put clear children on wrong button.
ok i will be checking that
Probably gonna get some issues with how you set the icon and text on that widget Iceman11a, seeing how you loop an array and get row data
You probably want to just notify the created widget about its rowname or index or smth, and use that for the row lookup
Can anyone tell me what the "World context object" is in the Async save game to slot?
im trying to rotate camera on the z axis as my mouse moves but it only seems to be happening whenever i hold left click and drag my mouse
is there an event that will give me mouse x whenever it moves
Sounds like u got visible mouse, capture on hold
and how would i change that
Mouse visibility is a setting in the playercontroller
Not sure if thats enough or if you need set input mode game and ui with capture always
Cant recall
im already setting its visibility to true i believe
oh yeah thats probably what i need
setting input mode to game only seems to be working fine until i left/right click on my screen
Got any logic on left/right click?
nope not at all
Hmm.. then i dont have much suggestions 😅
thats the entire bp if it helps
Id suggest having this logic in playercontroller/custom pawn and not in the level bp :p
thatd make sense
But dont wanna come across as toxic ™️
Not sure if thats causing any issues tho. I wouldnt expect it to
ill see in a moment
Anyone know why my color binding function is not working. I have a widget for inventory slot and that is working just fine getting the name of the item
^working
The function ?
Returning no color?
Or wrong integer read ? As in, 0
Also not something id put on bindings. They easily become costly due to updating frequently.. Doing an event based approach is preferable
ik the int is right
bc im printing and chekcing
1 sec
they are all white
if I unbind and set a color that works
not sure why the color isnt getting properly
Print its value
Thats not the color value
created a seperate bp class for the camera im using now but im assuming im doing something wrong since nothing is happening
Print thenoutput from the map
Color out pin?
You probably have to enable input on the actor
Break it, print it
Weird.... I think its just showing all 24 values of the array
but also its all retruning 1,1,1
Thats white
So the function is the issue ?
🤔
Show the function internals?
Either it doesnt find it
Ik it works bc Im using it in other places
Or it dies during conversion
Might be it
Test, iterate, test, iterate^^
If yoy always do the double conversion, perhaps consider swapping type in the map
Perhaps? Dunno, dont work much with colors 😄
Also, on finds, i'd consider always verifying with the bool...
Can save you some trouble when troubleshooting
If nothing else, atleast return some odd grey color or smth if no color is found
But what is bound to this binding
How can I create an editable list during gameplay that can also be modified during runtime (items move up/down with click drag) and be able to be executed one by one?
Ue5 aswell... could be anything then :p
Try setting the color value when the eidget is created instead
Just thought I'd share as I finally got it working. This setup allows you to get a location in a circle around your character starting with 0 degrees in front.
Thanks for sharing @hexed glade
Looks pretty complex, is this a specific location or a random location?
If its random, getting forward, rotate by random z , and multiplying with random distance between 0 and radius does very much the same
You can pretty much choose what you want. Radius is how much out from your character you want to set it and the angle can be set as random by setting it as a variable through a random float. Just remember that the max range is -180 and 180.
Right
So rotate forward by angle and multiplying by radius does very much the same?
How to get the first item of an array please ?
Get(0)?
@gentle urchin so it works now
Thank you
but I didnt change anthing
Ue5 😄
Hi, I'm trying to cast from an UUserWidget (created in c++) to my specific class in this blueprint, but for some reason the casting fails and I can't understand why. Any ideas?
All I did was change the return value to color
then back to slate color
lmao it works now idc
It looks like I can't get the enum being the property of my actor somehow 🤔
What type is the array ?
Thanks for the tip. Managed to simplify it a lot.
hi, im not sure what to set there
Ive created the widget in same blueprint in a custom function and cant access its variable, self doesnt work either. thanks
I think you need to elaborate a bit more. You're trying to set the "Is Critical" variable within your "Floating Damage Numbers Widget" widget?
Im trying to make my floating damage not just normal but crit and if crit another animation plays, damage and floating function + all anims are already done, i just need to hook it up in the game logic somehow and im not sure why I cant set isCrit in this case, what target does it want? Just an Object it says, everything is an object.
honestly I just dont know what to post to get help, all yt and everything is either outdated or isnt finished, and i cant find any proper courses to blueprints, so thats that
I would just stuff the functionality in the same component
Component having a canvas, adding flost widgets to itself,
Where the float widgets play their own animations. Fire and forget setup 😄
guys anyone know how to make this stay bec when i test my game i must click on it again
not sure, i have enemy which have a apply damage func which aims at player, so Im getting player ref into enemy instance.
same goes for player, it has apply damage func which aims at enemy, so im getting enemy ref into player, now its a widget which spawns a number of enemys world pos, converts to screen and add to viewport, after hit on enemy is recognized.
Then the widget animation is played, one for crit and one normal. Crit is just resized during animation for the pop.
The floating damage function is to calc and set all the necessary positions.
So now Im trying to squeeze the widget function somewhere in enemy graph.
Pinged you in umg with a suggestion ^
I know this is may not be very helpful, but hopefully it may help you understand a little bit.... You're the one that would know in what class your Is Critical variable is stored - no one else really would. What you're asking is like me asking you where I put the "Has Cheese" variable in my game - there is no way that you would know.
When you're looking at variables that have targets like that, the target needs to be a reference to the instance of that object class you're wanting to change the variable on - and those variables with targets are usually typed as well and it'll tell you the appropriate object type when you hover over it. That's why I asked the question I did - I was trying to determine if that Is Critical value is potentially within your widget class.
As to fixing your issue, you may just want to pass the value into your widget on your "Floating Damage" function by making the variable in the widget "Exposed on Spawn" and "Instance Editable" and then refresh your "Create Widget" node. You can then add the boolean IsCritical to the input of your function as well and directly feed it into your widget creation node. (Probably should do it for your damage as well!)
Hi. I have this system to spawn objects in a grid pattern. I want the Amount variable to also make it go up in Z axis as well. How would I go about doing it?
Add another loop
All good loops are tri-nested !
But for reals, if you're doing it for every single value of X Y and Z... Then you may only need 1 loop.
If you can't do it in one loop don't do it at all!
I see. Can you exemplify how this would be achieved? Thanks!
.
thanks (New to ue5)
Heyo peeps!
So I've hit a bit of a wall, I'm working on a FPS stealth game and want to make a mechanic very very similar to Thief 4's Swoop mechanic, where essentially, pressing space + a direction makes the character just for a moment get on all four and haul ass in that direction. It's essentially just a stealthy dash, but I don't quite know how to go about creating it
The only dash I've gotten to work is one that pushes the player controller up into the air and then shoots them in a direction, but I need this to work up ramps and stairs, as well as not fling them off of edges
This is the dash BP I have atm, jumping is done from standstill and dashing is direction+jump
ah, i wasnt aware of those exposed on spawn and editable checkboxes, many thanks
First image is in the Weapon. Second and third are in the Widget
So I have been fixing other stuff and im back to this. I have a widget that delays the name of time items above it when a player stands on the item
The issue is if I and collidng with more then one item is diplays the name and color of Only 1 item on both of them
I wouldn't use launch for htis
I'd set down a timer that moves a certain distance per frame
I know launch won't work well for this, I just don't know what else I can use
the node search tree thing is a bit overwhelming haha
or you could use a timeline as well, since you could use two tracks for that, the other being the camera bob that happens during the swoop
for preventing people falling off edges, trace each frame/tick/timeline update from the character to the ground, and if it exceeds character height (or some other such value), stop the movement
it's not rocket surgery
Ooo gotcha gotcha,
I was playing around with setting player movespeed up really high for a second but it just didn't feel right
as for falling off ledges I more meant that the launch, well, launched me off them, might not be rocket science but I'm not particularly bright when it comes to code
Thanks for the help though 😄
try the timeline, multiply the distance you want to cover by delta time so you get per delta movement, then use something like set location
I remember doing something similar for a megaman x style dash
which already came with the dash jump mechanic built in
Make a function that returns item coordinates based on it's number. Idk what you want your fill pattern to be but something like
i = ItemIndex
Item.X = i%10
Item.Y= i/10%10
Item.Z = i/100
Would fill in a 10x10xWhatever grid
Not sure about order of operations but you get the picture
Just curious, what happens if you have an event with an array input that leads into a for-loop, and then you call that event a second time while the for-loop is occurring?
Does it wait for the previous for-loop to finish before iterating through the newly passed in array, does it override the current for-loop with the new for-loop?
That's not a thing unless you're using some latent nodes
I think.
What health does it have when you just place it in the level?
You can also try doing simple addworldtransform and setting up invisible wall for sweep blocking.
but if i delete it out the world and use spawner node it spawns ai with 0 health
My take on it.
When you manually place are you just copy pasting one that already exists or adding (dragging actor bp into world)?
So then, what would happen in the event of something like this (just drafted it up as an example, not actually using this for anything)
I'm curious what happens to the previous "ActorArray" and then currently running for-loop in this kind of situation
dragging the bp into the world
Nothing. It'll run the same every time you run it. It's not like it's spawning off threads to run these loops while the main execution proceeds. It's all sequential
this looks like an infinite loop
This code hurts me so much T_T
Each sword object has its own widget component, yea?
hello, i create a anim notify and now i wanna check when the anim notify over. because i need do some thing in anim bp so pls help
I didn't see the call to itself in there, that would get real f******. Since you're not using a function variable, you are using a variable that exists on the object. That will get all sorts of scrambled. Also what you posted here would never halt
Sorry, it's possible I'm being dense (and that was a bad example given the infinite loop thing, I more just used it to illustrate what I'm trying to understand), but lets say I called that event elsewhere, and passed in an array with 100 actors, then, after the second index, that event gets called again and an array of 50 new actors is passed in, do the original 98 actors get iterated first? Or are they disregarded in favour of the 50?
yes
Thanks!
So I am trying to animate something from my actor blueprint in sequencer. I have variables set for the items that I want to animate but when animating the values from 0-1 from the variables I am not seeing anything happen in my persistent level? I have expose to cinematics checked on in all of my float variables and no errors running through my construction script. Does anyone have a tutorial or any advice?
@odd ember How do events work internally in these situations? I had never thought about it but if you tried to do a recursive function with an event, is there no call stack?
.
meant to reply with that message,
Yes Each Sword has a widget component attached to it.
And yes that code also hurst me a bit atleast part of it lol. Ive been reworking alot of the logic in my blueprints and this is one of those areas
also it does not work as intended so
well.. try to check if the variables are being set the way you think they are
well if it's recursive it's on the stack. but if it's two separate calls it would finish the first call before accepting the next
and check that the variable's value is .. impacting the way the animation works
@hollow inlet what do you mean by that
if the value is 'blue' is the thing blue
and then figure out what's wrong with how you change the value
anyone have thoughts on how to do a sort of time.sleep() to delay between steps in a loop?
first thing that I'm seeing is once the value that is being animated in sequencer its not passing the value back into the blueprint
In BP you can rig up a for loop with delay. Otherwise I'd use a timer
It is animating the variable in the default slot
use a timer, not a loop
w h y
because loops are happening at instant speed
don't just give commands with no context
i am literally visualizing an algorithm, put your fucking pitchfork away
just to indulge you
now tell me i'm in the wrong channel
The binds aren't really necessary. Something like this would make it so each item is only modifying it's own widget, and that your widgets aren't looking at every possible object the player is overlapping. When I say "create a variable of your base item type", I meant within the widget class.
so i have this anim notify_state and i want to put it on my anim bp so when its true change to other animations for example. how do i do that?
@hollow inlet you can hack up the BP for loop macro to adapt for delay but it's hacky. Timer is the right approach.
Anyone knows how I could smoothly set the positions of a ghost replay? Every 0.1 seconds I store the location and rotation of my pawn. After saving, I want another pawn to replicate my route. When and how should I interpolate between those transforms?
ill see what I can do with this, I do have a base class btw for the weapon which helps
thanks much
Interpolation functions. Specifically Lerping through the array using the time of the replay.
And should this happen on tick, or also every 0.1 seconds?
whatever feels fluid enough
if you can get away with a value higher than tick and it works, do it
Figured out that I needed to have checked on Run construction script in sequencer
When I made a component for this, I just used it's tick. Disabled it when done, and enabled it to start.
can someone help pls
Custom macro. Copy existing foreachloop or forloop one, insert delay on the bottom part of the sequence
@gentle urchin can you help me
Carefull tho, im toxic :trademark:
we're all toxic
@coarse cipher Basic idea is that you can get the array index you need by getting the time along the duration of play. So if you save 3.0 seconds, you'd have 30 array entries at 0.1 second per entry. You can access the correct array indexes for lerping by taking the time that has elapsed, and dividing it by total time. This gets you the percent that has elapsed of the timer. EG 1.25 seconds passed in a 3 second timer is 0.41 or 41%. Total time/Tick rate, or in this example 3.0/0.1 = 30. So now you use your percentage to access the correct last point on the array by doing 30 * 0.41. This gets you 12.49. If you floor this number, you can use it to get the last point in the array as index 12. This is the start point of your lerp. Also get the array index you just got and +1 it to access the next array index. Then you mod the 12.49 by 1 to get the remainder of 0.49, you use this as your Lerp's Alpha. Doing this you can lerp the entire way through the array.
your advice also seems bad!
I would suggest checking out the ActionRPG project, it has some nice examples of combos
How so?