#blueprint
402296 messages ยท Page 742 of 403
I think we're not really disagreeing ๐
May I should say don't think of it as a snapshot in time
The first time i enable that time line it kinda works ... after releasing and clicking again it freaks out as the rotation keeps ading to itself although the delta gives me 0
set the "old" value once before the timeline
or it will refer to the old value on the first frame (now all in my mind is time ๐ thanks guys)
That Fixed the Wrong rotation at the beginning but the second click still freaks out
it could be flipping around an axis, not sure
you cant force that freak out on the first click?
I don't know why my brain isn't working anymore, but what am I supposed to pin into the wildcard so I can get the variable into my widget?
the thing you want to cast
it asks for what MySunPositionBP inherits from, which is the BP_SunPosition
it craves it
yea but I can't get it in the list, it only shows its variables not the actual bp like regular bps
you have to add the communication for it somewhere
the cast node isn't a magic node that will get you what you need
I didn't say it was lol
most likely you'll do a get actor of class in the construction event and save the reference on the widget
well the way you've set it up that seems to be your line of thinking here
pretty short line
I think there is a pinned video on blueprint communication in this channel, I suggest you watch it
I decided to do all the stuff I was doing for day night into a separate class as recommended earlier, so I made a new class that inherits from the plugin class
I had a get all actors and promoted to variable as sun position object in the level bp, but now I've moved it into event begin play in mysunposition bp instead. Should I have done it in the level bp to access it in the widget?
get all actors is a cheat code basically
it supercedes good architecture by allowing you to call things without connection
however, the level blueprint naturally has knowledge of all actors inside of the level
^for a while thats what i used the level bp to (long time ago), connecting up relating bp's that didnt have any ordinary means of communication
it's still valid to use for level specific logic
a while ago I was told that I should separate something like time from the level bp so that I can have multiple levels. While I don't need that now, I decided to try it out for learning's sake
For level specific logic (i have yet to encounter something specific enough), I'd probably just hard reference it
where do you create the widget? can't you just pass the actor as reference on creation?
character bp
IMO this is architecturally unsound
I followed a tutorial that was for a character-related HUD, so I'm kinda adapting it to this
it also makes it really hard to maintain visibility of what is going on
Nop, It always Plays right the first time ( sorry i was away )
since you'll have to check every actor for specific things, on the actor
level BP exists for a reason
True that. Not perfect in any way
Just feels dirty using level bp
why?
some comment some time ago that stuck with me that i cant recall
it's way dirtier using hard references
ok so what's the suggestion?
mysunpositionbp is handling all logic for time
widget is being added to viewport in playerbp
I need variable from mysunpositionbp to bind it to the widget
if you're doing hard references you might as well be doing get all actors of class
it's the same thing
just once deferred
Well, you'd need some method of picking the correct ref with the get all method
it also actively prevents you from creating good architectural setups
so you'd need some unique identifier (tag) or something to get the right reference
yes
guys ๐
level BP even allows you to use delegate calls as events so you can have events for level actors directly in the level BP
use the cheap GetAllActorsOfClass if you want it quick, or pass a reference on widget spawn and get up to speed on BP communications if you want to do it the harder (but ultimately better) way
Guess i could open up about using the level bp for stuff, and avoid hard refs. I usually stay away from hard refs like that in general, for the same reason i dont hard code values in the code etc
as you point out, having to check X actors if their hard refs are correct is just a pain in the ass on a level thats bigger than the template-level
I just did this before reading this message. Is it correct?
probably? if that's what you want?
I don't know
it's a line of code that makes sense
^ Get it once, save it, and use that ref? This looks like a binding ..
yea^
I just wanted a reference. Normally it's pretty straightforward to get stuff done e.g. get player character -> cast to character BP in everywhere else but in widgets I've encountered this. I did widgets like 2 years back last so it's pretty much gone from memory
generally I stick to the format of having all level scripting done on a separate level
i told you 20mins ago what to do
which is not the same as the persistent level
why don't you just use that as solution for now?
Missed it because of the other discussion that pushed it up
@spark steppe I have the reference saved in the my sun bp itself in this same get all actors method (I copy pasted it from level BP so I'm sure I don't need to do this anymore in this format)
this was in level BP before
so should I put this back in the level BP in order to get the object in the widget?
you just do the same in your widget
okay
on event Construct
Is there a way to check if the player is in a specific level?
and make a boolean out of it
i think there is an "is actor in level" node or something
okie dokie, done, thanks
in fact the only place I can even see that check being made is in a World Subsystem
yea right, you need c++ for that
cool thanks
giant trigger volume and begin overlap ๐ (don't do this I'm probably wrong)
+10 points for creativity at least? ๐
for something that 1 line of c++ can do?
bool AreActorsInSameLevel(AActor* actorA, AActor* actorB){
return actorA->GetLevel() == actorB->GetLevel();
}
level specific logic is generally off limits to BP because it requires access to World
you could perhaps query the player for their current level
however
Okay I found Out If i click It and not rotate then realese and click and rotate it acts correct.. meaning that if the rotation of the object is not default (untouched ) then it will freak out
how do you calculate your rotation?
This is in the Playercontroller, and atleast so far its working
.
what I was saying is that you can't e.g. loop through each level inside a level
Makes sense. My simple mind has not been exposed to multiple levels inside a level sort of experience.
multi level management
persistent level knows its sublevels
world knows all persistent levels
Ah. Nice to know. Will come in handy at some point
world knows all persistent levels? thought there could only be one at a time?
why did i ask... ๐
yea you might flip at some point, can you print the rotation value to screen and see if it suddenly goes from around -180 to 180?
but then it would also happen on first run.... really weird
The Yellow Box Ways the bloblem
Thanks a Lot for helping me out โค๏ธ
all that for a can
it's all good
well i like that feature, was going to try to reproduce it. glad you sorted it out
now i can copycat the nodes ๐
ok so seems when the time is in single digits (e.g. 09:05), it's going to print 9: 5 in the widget since of course, these are just raw numbers plugged in. What can I do to concatenate a 0 to the strings that are < 10?
Or am I supposed to have some sort of defined formatted counter thing I don't even know how to explain
I fixed what I wanted to do. Since im new to Unreal im still learning, essentially I made a timer for my game, but the starting area wasnt meant to have a timer. Since I made the timer in my player blueprint, i was dying after 30 seconds of being in spawn, I now moved the whole timer shit to another bp
Thanks anyways boys ๐๐ป
there are some nodes which take time as input and have a text output
maybe one of them suits your requirements
Thought id ask again because I'm still having the issue, I was wondering if anyone knew a fix to this problem, its been bugging me for a few weeks now but has gotten that bad in the past few days due to the addition of a car, I really need to fix this as its so easy to cause and effects gameplay hugely, if anyone can help, a response would be really appreciated, and thanks to anyone who even just reads this.
If you're using an int to represent the minutes, then when you're converting the int to text, you can click the little triangle at the bottom to get some additional settings. You'll want minimum integral digits set to 2, then it'll always output an extra leading 0 if necessary
Also not sure if this affects the issue I'm having but its to do with rotation so I thought id attach it, this is how my looking up and down works, idk if this is a bad way to do it or not though: (also oddly enough i tested it and the cast always returns as false even though the cast works perfectly, not sure if that's good or bad)
Ah, excellent! Thanks. I had opened the nodes up earlier but didn't read that lol my bad
better example of the issue:
This is pretty hard to say, but if it gets screwed up when you enter and then exit the car, that seems to suggest something in your pawn is not reset correctly
For example if you have any roll rotation that could affect it because character movement comp and the mouse aiming logic hates roll and doesn't make any attempt to work correctly if it's not 0
is there a way to reset it after exiting the car? also ive had this issue before when my character walks down a slope, but its not happened for a while so idk if its fixed, but the main issue is the car, so if you know how i can make it reset itd help a bunch (also sorry about the ping i forgot to click the un ping button)
There's no real "reset pawn" function so you would have to figure out what value gets messed up and just manually set it back
If all else fails, you could try destroying the old pawn and spawning a new one
the issue with respawning my pawn is im pretty sure itll also reset all ammo and health values, and i know that the pitch is the value that messes up, i just dont know how to make it set to 0
i have this on an event tick but i feel like it does nothing
Is skeletal mesh the root component?
Because most likely the root is what's got the wrong roll if that's the issue
ngl I'm not sure which one the root is, I'm assuming the capsule component but I'm not sure (also idk why i have 2 meshes, the skeletal mesh is the only one that does anything)
sorry about me not knowing any of this btw, im really new to unreal
Yeah root component is the component which is the "topmost" one in the component tree, so yeah the capsule in this case
i think resetting the roll of the capsule component every tick worked, not too sure tho, ill test it more, thanks for the help
Ok folks, I got a super dumb question here. I'm fairly new to UE and I'm just trying to do a simple thing here which is - debug/print string when a key is pressed.
I have tried changing blueprint classes, used Input mapping, but nothing works. There is nothing in this project except this BP which is a component of a plane. Hello gets printed when I start the game but no key input is being printed.
If that fixes it, you most likely can just do it once when you exit the car and not on tick
nvm its broken again, it fixes it the first time you get in the car, but if you keep getting in and out it slowly breaks, its really weird how it fixes it the first time but still breaks, also it makes my game drop to 0 fps when getting in the car and spawning for a second
How do i disable blueprint temporarly i use blueprint just for prototype for c++?
What blueprint is this code in?
it is under Pawn class, there is nothing else in this BP. I tried using Character class too but same issue.
If thats what you are asking
So I'm guessing you placed this blueprint in your level, yes?
Yes
Ok, did you set it up so your player posesses it?
I'm sorry, I didn't get it.
There is no player in this project yet. I was working on another project where I was having issue and thought maybe other BPs are causing the issue. So I started with a fresh blank project, added a plane and directional light, created this BP and attach it to the plane. I'm sure I'm doing some basic mistake here.
Is there a way to hide a hud bp on specific levels?
health bar ^
wait i can make a boolean right
There's always a player. Whenever you start a game as a client, a player controller is created which is what takes your inputs and does things with the game. It doesn't exist as an actual character or pawn in the scene, but it is still present. Player controllers can possess pawns or characters which will route that player's controller's inputs to the pawn or character they are possessing.
When you set up the inputs on a pawn, all you're doing is basically saying "if I'm possessed by a player, and they press these keys, do these things..." Inputs are not automatically routed to any pawns or characters.
To get your player controller to possess your pawn quickly for testing, you can select your pawn in the world outliner in the top right of the screen, and when selected look under the details tab, and find the "Auto Possess Player" and select Player 0.
It reduces how much the issue affects the camera, but after getting in and out of the car the issue gets back to how it used to be, so setting the X of the capsule doesn't fully fix it, but the capsules rotation is the issue
Thanks @dawn gazelle for the quick explanation! I really appreciate it. I tried but I'm still having the same issue. Created an Empty Pawn, attached my BP to it and changed the "Auto Possess Player" setting as you said, still I had the same issue. I have also added ThirdPersonBP feature pack, changed setting in the ThirdPersonBP's setting but still the same issue.
I was messing around with max limits and noticed something. tho it might be obvious but the numbers like to snap to the limit at a certain point. So is there a way to tell where the limit is before overflow? like with floats I hit the flow limit I think of 9223372036854775808 (overflow?) so here are a few thought i hope to get working.
- take the idle game idea and have insane values.
or - set a cap limit but I am not sure where that limit is before it jumps to the overflow and breaks alot of things.
Attaching a blueprint to another actor doesn't route the controls to the attached blueprint. In your scenario, your controls would be routed only to the ThirdPersonCharacter
I thought that which is odd as that is not the limit i am getting. Unless there is is something that is a 64bit int somewhere blocking it. hmmmm welp going to mess with numbers and try and mess with the numbers.
YOU ARE THE BEST!
So basically I will add a pawn and edit its on blueprint for Input. right? My understanding was I could create new blueprint and attach it to the pawns or characters and that will work just fine.
Not really no, as it doesn't make a lot of sense attaching a pawn to another pawn or character. What is it you're trying to accomplish by doing so?
(I should say, there are cases, but usually it'd have to do with putting a character inside of a vehicle as an example)
Reusability. Create a blueprint with various variables which can be used by different pawn or character with some custom tweaks.
I know that's not the way, I just thought maybe that was possible.
Hey guys does anyone know how to change the duration in seconds into FPS? Im trying to get a print string to print every frame instead of second
I know it's possible in cpp since you can provide a key to the debug message. I don't think it's possible in BP
Ah okay thanks @meager spade Im trying to get my string to output 30 times every second and doing 0.033333 will cause problems for me, later on cause its not gonna line up exactly
If you can do it in cpp just provide INDEX_NONE in the first parameter in printdebugmessage
why is my timeline jumping from 0 to 12 and then carrying on as normal?
I'm doing a separate timeline for setting the seconds because I can't seem to figure out the maths from the original timeline maths for hours and minutes. So a jank thing once again, but it works perfectly fine if every minute = one second, but if I double it (every minute = 2 seconds) then it goes out of sync like this
are you doing some kind of rotation
just updating the hours, minutes and seconds fields in the sun position bp
right now the curve is set for 2880 duration (2 seconds per minute, 1440 minutes in 24 hours, so end point of 2880 has value 1440).
If I set the duration to 1440, so every second = 1 minute, then it's all fine
make your hours be in floats
I'm pretty sure it's because you're dividing integers
which can't be rounded
I don't see any issues with you truncating minutes from float to int
sun and sky takes floats and is a lot easier, but it has no connection to sky sphere which means night time is completely dark which is why I'm stuck with this version of the sun bp
Not the greatest way...
You have a few options:
-
Create a "base" blueprint (can be character, pawn or whatever you need) that contains everything you could possibly need, including any functions, inputs, variables etc. Once created you can create child classes of that blueprint and override anything you need to such as inputs and functions, and you can then create child blueprints of those blueprints which can override things further. Along the way you can add any additional variables and functions in children as well.
-
Create and use Actor Components - these can be added to any pawns or characters, and can contain functions and logic in them, but not direct inputs - you would have to route the inputs from the pawn/character to the component in order to use its logic, or read values from the component in your character.
-
Attach Actors rather than Pawns or Characters Pawns and Characters are meant more to be moving objects in the world that can be possessed by players and AI. Actors can be objects that are not possessed. An example of this could be something like a gun - when you attach the gun actor to your character, the character could hold the gun appropriately, and when you press the "Fire" button it passes info to the attached "Held" weapon, and then the weapon can then do its thing. Similar to the Actor Components, you'd have to pass values back and forth between the attached Actor and the character.
then it just makes the seconds also move at 1 second per 2 real world seconds
i.e. minute 1, second 1, minute 2, second 2, etc.
it's not going to change your logic
and so that leaves the sun still moving in a jarring way
but it will show you the error
this is how I understand it so far:
if I have one minute change for every 2 real world seconds
then I need to change the seconds field from 0-59 within 2 real world seconds
this is why I used another timeline to span 0-59 within 2 seconds
it works if my first timeline (for hours and minutes) is using 1 second as 1 minute
but that's too fast
so for 2 seconds for 1 minute, it goes out of sync
ever so slightly
so the sun is kinda moving back and forth
hope that made sense
do you want it to work
as I mentioned, if I hook up the minutes to seconds directly it does not work
I'm not asking you to hook up minutes to seconds
I'm saying make your hours a float value
so what did you mean here
that you are already doing it
from which node?
the timeline is putting out float until I divide it
which gives the int
you want me to make that into float and connect that to the seconds?
no
read what I said
or actually just put down breakpoints and see where it breaks
that will find the issue easier
but it's almost certainly a rounding error
because you divide
and only use the whole number
but there is no problem with the hours and minutes part of the code
so where is the code with the seconds?
sorry I thought I took the shot properly but I missed it out
that timeline is for separately calculating 0-59 within 2 seconds, which is jank I admit
yeah so it is a rounding error
you should be calculating alphas inside of timelines, not real values
then multiply the alpha with whatever number you need
then you also only need one timeline
a timer @zenith trout
drag the red pin out > create event
then pick the event you want to repeat
and look up google how it works otherwise
any suggestions on what kind of an alpha range I should use? Regular 0-1?
the issue really isn't the return values it's the duration that is causing my head to spin lol
0..1 is the alpha range
giving me high school flashbacks where I would get headaches from these time-calculations in maths classes lol
the duration and the last keyframe are probably not synced up either
if I had to guess
I tried both enabling disabling use last keyframe and it didn't seem to make any noticeable difference (except when duration was set for 1 minute per second)
your last keyframe should be set at the end of the duration
yea it is
how long is the duration
So, basically I have to create a pawn or character which has all the inputs or base functions, variables. Then create child blueprints or actors who can access those inputs and do something.
Now, going a bit off topic and I'm not sure whether this is even relevant to this. I used to create something like GameManager in Unity where I would keep inputs or global variable like say health or player state, etc which were further access and set by other classes. Now, I see UE has PlayerController which I can create with custom GameMode. Is it an ideal way to create all the inputs or other variables in PlayerController Blueprint which is further accessed by a player or npc character or any actor component?
I know I'm jumping guns here but just want to have clarity about the ideal practice with UE and BPs.
Thanks @dawn gazelle you have already made my day, not sure how long would I have been stuck on this. I really appreciate your help in this!
2880 real world seconds
I'm now thinking how to map the alpha range to the 24 hours/minutes/seconds
you multiply the alpha value
and handle calculations outside of the timeline
or even better, lerp values
that solves your issue with truncating results
24 hours = 1440 minutes
120 seconds = 1 game hour (if I want 2 seconds to be 1 game minute)
so no timeline?
so that will be 3 different lerps from the same alpha
no you need the timeline to supply the alpha
ok yea
actually that's a lie, you'll need 3 alphas. but not to worry, you can create them all inside the same timeline
so one for hours (in real seconds), minutes (the same), seconds (the same)
so one hour should be 120 seconds in the timeline, a minute would be 2 seconds, and a second would be 2/60, which is just about 2 frames.. about 0.033 second
does this make sense
yeah but why would you want to do it like that
I dunno just the most obvious thought in my head lol
I did this just before you wrote your new message
ok ints aren't lerpable
ya mon
that's some weird math going on there^
just want the level to start at that time rather than midnight/dark
don't I need to multiply to get a whole number e.g. 0.25 x 24 = 6
so.... set the timeline to start at 0.25 play length
your float value goes from 6 to 24, why don't you just truncate the result of the timeline?
otherwise you won't ever get to see 00:00 to 06:00
I was thinking of going from 0,0 so that I can use the same track for minutes and seconds rather than those starting from 0.25 as well
For this I did this bit of genius ๐
the original only plays once and then goes to the new one for a complete 00:00 to 24:00 loop
i know TOTAL JANK
actually, why do you use a timeline at all?
just... why
it's like you had a resevoir of clean water next to you and you decided to walk 5 miles to get water from a dirty river
๐
that's missing out the obvious fact that I don't have feet and am stuck in a spaceship
don't question my life decisions ๐
get some sleep maybe?
like a lot
like I don't have super well rounded knowledge so I'm working with what i'm seeing in tutorials/whatever I know etc.
if someone offers a better solution then that will add to my knowledge
there's a reason people say start small
I try to but these days I'm having night terrors so it's kinda rubbish quality sleep
isn't this small enough
if you're in here asking questions every single step of the way? no
yes
i think you are overengineering your problem
you want to map realtime to gametime, right?
I'm not asking every single step of the way I'm asking when I'm encountering problems,
I want 2 seconds to be 1 minute in the simplest words
2 real seconds to be 1 game minute
this is like the second or third step where you're asking. if you're sleep deprived it's not helping either. nobody is going to do math well at that point
https://www.youtube.com/watch?v=qWSu2C4ANE4&list=PLDnygpcOYwFW2XtNyiandrLDG__OAZs7Q&index=6 This is the video I got my in game time from. Honestly don't remember exactly how he did it but you should be able to scim through it and get some knowledge
In this episode we set up our custom date and time feature which will eventually attach to things like our game speed, build times and other features. Enjoy!
To Custom Day/Night Cycle tutorials:
https://www.youtube.com/playlist?list=PLRj2My38wl9bcycvj_NssOy2f-cFNzPKH
----------------------------------------------------------------------------...
I am primarily an artist so all of this is a lot more gnarly for me even if I understand the theory fairly well. But working with game engines means one needs to become very familiar with someone else's logic (the people who wrote the engine, the ones who developed the API and rules). Considering how intricate the engine is, there are a lot of 'rules' to playing the 'game'-engine, pun not intended
that issue is unrelated to the engine
there was a time 15 years ago I could do all this in C++ without much of an issue, but again, that would be me writing from scratch and setting up everything myself. This is a different scenario
the rules are very similar between engines, and between most programming. this engine is no different. the big difference is that it unfortunately makes some end user friendly concessions that end up teaching people without the knowledge the wrong things
Check the video I sent, he doesn't do some stuff in a very good way but for the real time to ingame time stuff you should be able to get something
thanks I'll check it out
as said, thats a simple multiplication and you have your ingame time
idk why you make a big deal out of it
how am I making a big deal out of it lol
I'm just asking for feedback / better solutions that's it
3 timelines ๐
yea another problem with that end user friendly engine is that there's a bunch of tutorials which teach crap
and I couldn't figure any other way to make the bp plugin work, the other solutions of my own I tried on tick for example would kinda sorta work but not really
just jank to go through it quickly and see before I optimise things
or people don't understand why the person is doing something that way
the tutorial was fine because it was just like a proof of concept if you will. It had no real requirements like I do where I want the time to be slower and I want the seconds incremented as well
the original tutorial had the speed quite fast, 24 seconds for a full cycle (basically mapped 1 second to 1 hour) which means the sun was moving fast enough to not be jarring
I only realised I needed to increment seconds as well once I slowed everything down to the usual pace of day night cycles in games
I would use the sun and sky bp that uses solar time as a float value, so just 1 value making it really easy and simple, but for some bizarre reason Epic decided it won't use the sky sphere and doesn't take any, which means at night there are no stars and it's pitch black, so I can't really use that
you can use a night scene capture for the sky sphere
they decided to not force anything on the developer
no I mean the sky sphere does not work together with the sunandsky bp at all
they don't communicate and can't
so if I recapture the sky sphere, it doesn't recognise any sun that it can use
because the sun in the sun and sky is nested within the overall plugin, which the sky sphere can't see
the older sun bp that I'm using right now does work together
i have no idea what you are talking about
is that a specific plugin or example blueprint?
ok so there is a plugin called "bp_sun position"
this will work with the sky sphere and directional light in your world
there is another plugin called "Sun and Sky"
I believe this is the 'new' one
both from epic?
default in the arch viz template
yes
but this one has a directional light and another thing nested within it, as components
but it does not work with the sky sphere
so if you want starry nights, you have to use the older one
well, you can't take anything out of an "asset" and expect it to work the way you want it to
the older one uses separate values for hours, mins, secs
the newer one has one value called solar time, which is a float, from 0.0 to 24.0
so it incorporates mins and secs within that one value
you should rather try to understand how those blueprints work, rather than trying to adapt your game to their requirements and limiting yourself
for this new one, it's really easy to just hook up to event tick, delta seconds x whatever speed I want it to increment and plug it into solar time more or less
there is almost zero material out there for me to read or understand in the first place
there is literally only 1 tutorial which I used and that is the timelines one
for the older sun position bp
the sunposition is just rotation around the world, isn't it?
yea but it's geographically accurate
with lat, long, north offset, timezone, etc.
location
date
everything
and I need those
๐.
so you see :p
cause the reason is that I've made a place as accurate as possible, a real place, as it was in a real point of time in history
so the lighting needs to be correct as well for that time, which the bp offers easily
Is it possible to change an actors movement mode in runtime? Whenever a player possesses an actor id like to switch it from navmesh walking to walking but as far as I can tell it doesnt update (same weird interactions during navmesh walking)
sure, just set the movement mode on the movement component?!
what kind of weird interactions?
Thats what I do - walking through walls, vehicles freaking out when they stand on them, ect. none of which happens during normal walking
you could try to disable the component before setting the mode, and reactivating it afterwards
but this somehow doesn't sound like an issue with the CMC (tho im not sure)
hmmm ill give it a shot - thank you!
get array A, set array B and plugin the array a as input of the set node
what's the data type of the array?
they should just copy over to array b
oh
you want to compare 2 arrays, sorry, i did misread your question
iterate over one of the arrays, and check if the item exists in the other array, if so add it to an temporary array which holds the duplicates
there's the "contains item" node for arrays which you should use for the check
anyone knows why in packaged when trying to change resolution in fullscreen my screen flickering?
like trying to set resolution but cant
should i try with command instead set resolution node?
what should i do?
you should explain what you want to do
because the node setup doesn't really provide any informations
other than that you want to set somethings location when something got hit
if i hid the obj (pad) i want to change th location of the "blockrunter"
and blockrunter is what? some other actor?
yes
do you have a reference to it on your pad blueprint?
no
does blockrunter exist multiple times or only once?
once
then you can use a get actor of class node
and set the class to blockrunter
and use the output for your target
thanks!!!
i cant get my replicated health to appear on my hud, it never updates. How can I fix this?
this is my health component
could i just make health a rep notify or something and cast to my hud to change the text
it does in fact change on the server correctly because this shows my the correct damage being taken
Yep
hm okay is that efficient tho? I was always under the impression that casts are expensive
Casts are only bad once you get into the 100000s of them per second, and even then, it's minimal impact.
If you're worried about it, you could also set up a bind which is effectively making it update the value on tick - which again, takes literally hundreds of binds to actually see any kind of performance impact - so long as you're not doing some complicated math with them and just using them to display the value, then it's not really a problem.
i see thank you for that information
You could also do the reverse - have your OnRep call an event dispatcher which your UI binds to - then you only have to cast once to get reference to the object where your health is and bind to the dispatcher - the event can then update your health value in your UI
i will try what you mentioned above as this doesnt work
i have it inside of my rep nootify function for health
is it maybe an issue with how im replicating it? do i have to make it run on client as well?
Curious as the why this isnt working. I added a breakpoint and it executed but the Item Quantity never changes.
~Thanks
the foreach loop might give you a copy, not a reference to the real struct
Ah, so its not setting the actual value that I need to be set.
actually you are filling the array with copies
Darn. Is there a workaround to this?
make a function where you pass the struct as reference, and call it for each struct
but you have to set the argument explicitly to reference for it to work
at least that's the cleanest way i could think of right now
So the function would be what is the loop body? Then the input to the function is the struct?
no, you would screw of the loop + array
it would only do the addition and set the result
Anyone had any issue when you add a startup movie? Game runs perfectly without a startup movie. When I add the UE4 logo movie the game starts and....
Assertion failed: IsInGameThread() || IsInSlateThread() || IsInAsyncLoadingThread() [File:Runtime\Slate\Public\Framework/Application/SlateApplication.h] [Line: 225]
TheGame!FDebug::AssertFailed()
TheGame!FDebug::CheckVerifyFailedImpl()
TheGame!FSlateApplication::Get()
TheGame!FPreLoadSlateWidgetRenderer::DrawWindow()
TheGame!FPreLoadScreenSlateSynchMechanism::RunMainLoop_SlateThread()
TheGame!FPreLoadScreenSlateThreadTask::Run()
TheGame!FRunnableThreadWin::Run()
Im still a little confused. As you can see in the picture, the function is only called once so there is no reference to input.
you would make another function which gets called for each struct by the one with the red arrow
however it looks like your logic is somewhere earlier messed up, as i think you could avoid doing it for each item type
Hm. I cant see where as each struct has its own item quantity that needs to be set.
Im just trying to avoid this.
that's why you should make a function which takes the struct reference as input
that function only does your addition and set the value to the struct
you'll still have a function call for each struct, however it's not as messy as what you posted ๐
Oh, that makes more sense. Sorry a little tired ๐. Let me give that a try and then see how to loop the function.
no loop for you ๐
Is it possible to reference a material inside of a blueprint, if so, how would you do it?
you would create a dynamic material instance
To reference a material, you need to create a 'Dynamic Material Instance' in runtime and set it as material on your mesh.
Or you use 'Material Parameter Collections'
What if it is a post-processing material though, it would not have a mesh.
you know you can put <> around links so that it wont create previews?
oh really?
try it, and edit them ๐
I have Player Blueprint, and the camera has a material post-process material, and what I am trying to do it reference it so I can change the parameters.
like that
Alright, I will try this out, thank you so much!
You're not talking something like this are you?
yes
oh
but you have to set that input to reference
in the details
actually you are passing a copy, so it shouldn't work
It works now.
but it shouldnt ๐
Yea, once I ticked the Pass-by-Reference, it started to work.
Ok, so now it makes sense ๐
yes
Thanks for the help.
also maybe you want a loop instead of pasting the same function 10 times >.>
Oh thats true, I could just create an array of the structs, and then the loop body would be the new function. Let me try.
no
yeah, don't forget to use 'get (by ref)' instead of the normal loop element
your array wouldn't hold references
aw man, back to this.
unless you can set arrays to hold struct references, i'm not sure about that
pretty sure they would, you just need to get them by ref
but if that works, you can screw the function you made, and return back to your old setup ๐
just with references then
i was under the assumption that arrays cant hold struct refs
No, you're right.
they can hold object references
yes
not sure about pass by references
Doesnt seem so.
So is there a way to loop the function for each struct or is it just create a long train?
yea, don't hold them in separate variables like that
make a map with name as key and struct as value
I have tried this before, but found no documentation on how to access each structs value.
then i wonder where you looked at ๐
. . .
Oh wait. OMG
I didnt even watch the video yet.
๐คฆโโ๏ธ
Ok, so I havent put any values in the struct for the map variable, but would this work for what I want?
oh
or that
So then what could I do?
when you're using a map, you can just set them by name
I need this to happen for all of them.
like that
The map hold the names (key) and their corresponding structs (value), and since we're looping through every key, we can change the value of every key (without needing a ref)
Oh, so we are changing the value with a copy, then using the add, to override the values for that key?
exactly
Ahhhhh.
So now I wont need a struct variable for each item, but rather add it to the map, and it will loop and override by itself.
Yeah
Gotcha. Now I just need to figure out how to bind certain struct map values to a widget.
Your health component is on your player controller?
No, itโs on my regular character. I casted to the controller because thatโs where I reference my widget
So I made a custom event that checks the health and prints it. I made on that is on a replicated rpc and a non replicated custom event. From there I see that server is returning the correct health, and that client is returning 100 health still even if my character is hit. Is that something to do with it?
That's not how casting works. Casting is taking a less specific reference (like an Actor) and making it more specific (like your character) so you can access the functions and variables within the more specific class. It doesn't convert between classes, so you can't cast a reference that would be your character to your player controller.
On the OnRep, do a "IsLocallyControlled" branch. On the true, get the owner, then get the owner of that, then cast to your player controller and proceed as you were... Pretty sure it'll work from there.
Eg.
via category
(details panel of bpf)
additionally you can use ' | ' to subcategorize, for example; UI | Text or; Stats | Resistances
Is there a nice way of a having a 'marker' on an actor? Like, for example, with a vehicle, I want the character pawn to spawn next to the vehicle when they exit the vehicle. Currently I'm just using an offset, but its fiddly be nice to be able to visually edit the various spawn points.
I hope i'm not in the wrong thread - if i am then sorry. I have a little problem with widgets. I'm adding widgets to main widget via User created category (i'm using widget switchers and i thought it would be the best option). Widgets added this way does not contain any information. They are visually okay but progress bars are not filling up. Does someone have any idea how to make it right ?
For clarification: When i add widget via normal "add to viewport" they are working perfectly fine.
No help needed anymore.
is there a way to get a random item in a Set?, similar to the way you would get a random value from an array (generating a random index, for example)
? Can you not just use RandomIntegerInRange?
Scene Component?
you're welcome
Scene component or a socket on the mesh
@gray chasm I know I can do that and access an array, to get a random element in my array. However I was wondering if there is an equivalent way to do the same thing with a "Set" instead of an array. I can convert a Set to an array. but I was hoping to avoid that step and be able to somehow randomly access the Set, and get a value.
@opal totem if there is a node to get an item from the set by index, you just need to create your own function which generates a random number between 0 and set length - 1, then get the value from the set
There isn't. Weirdly, despite the fact it's implemented in TSet (ElementType& operator[](FSetElementId Id)).
uh.... I guess you can't without writing some C++ to pull the index out. nfi why it's not part of BlueprintSetLibrary.h
I think 'To Array' is as good as it'll get in pure BP.
I appreciate the feedback, not going to spend any more cycles on it. ๐ arrays will work fine.
Is there a way to clear a mesh or set a mesh to null?
Specifically trying to clear the actual mesh, not just set it to hidden.
yes, call setmesh and just don't add a reference, leave it blank
lmao, thanks. dunno how I missed that.
hey how do i make it so the buttons switch when i click on them? Atm they just print string for debugging...
couldnt find any good tutorial for what im trying to make
The buttons are being displayed on this tablet and here i would like to switch between the options
Switch in what way? Change color / texture?
You can look into https://www.youtube.com/watch?v=7Mbe-hQl0Yg
How do I get started with using the Widget Switcher in UMG in Unreal Engine 4 Blueprints?
Source Files: https://github.com/MWadstein/wtf-hdi-files
There are tons of ways of doing it though
In this video I go over how to create a main menu in unreal engine 4 in 9 minutes.
Check Out My Website For a FREE 3D Model and more of my content: https://www.uisco.dev/
Join My Discord Server (100+ gamedevs): https://discord.gg/WybzV92BKJ
-Ways to Support The Channel-
Check Out My Marketplace Games Assets : https://www.unrealengine.com/ma...
atm tryign this but idk
but ill check that one for sure
I use an enum driven State machine.
On button press...
UpdateUI(UIStateEnum)
Then I swap widgets around etc based on the new UIStateEnum
Hey guys, I'm having an issue that I cant really get my head around.
I want a certain object to change material etc. on every rendered frame, so normally I would just put it in the tick function of my object and then just render the sequence out using the movie render queue, however because I'm using subsamples in the render preset to give me better raytraced results, the ticks are firing on the sub steps(16 substeps pr. frame) - is there a way to make a function thats fired every frame and not on the substeps?
interesting problem....
i don't know, but as a worst case, could you change your logic to take a parameter for how many substeps between changes?
have you tried to set the tickrate to match your frame rate?
Not running fixed framerate, since there is no "fps" when doing the pipeline render as far as I know
hmmm, i thought it would still be framerate bound even when rendering for movie
then i would just add an integer which increases to 16 and gets reset then while switching the material
I mean, I think all internal things are done with a calculated tick, but as soon as temporal samples are above 1, it fires multiple ticks to get everything to blend together
What I've been doing so far, but it doesnt work with temporal sampling. So I guess I have to get stray away from using temporal and only spartial
ok, i dont know about that stuff, maybe someone else comes up with a solution
maybe virtual-production or something is a better place to ask
How to run UMG widget on the plane mesh of the Actor?
As in triggering the widget to spawn on screen or spawn the widget in the world space?
@feral shale is there a way you can differentiate a substep tick from a new frame tick? Like is there some frame number or timestamp you can get to make that distinction? If there is, you can maybe compare it to the prev frame data or something to produce a boolean and branch the logic off that.
I found out the issue I was having was temporal substepping, no matter how I wrote my code to compensate it would also blur the frame with the one before and one after
Are you sure? It seems weird that it would work for one but not the other. Have you got the frame count right? It's temporal * spatial samples.
Spatial samples doesn't fire tick
only temporal does
atleast thats my conclusion from my testing
Ahh ok yeah that would make sense. Was just trying to think why you would get blurring before and after still
I think it's down to how AA works in UE
Temporal sampling where stuff changes from frame to frame will always introduce bluring between the two frames
Presumably you have disabled post process motion blur and temporal aa?
yep
how can i make this repeat?
Repeat what?
the event so that it always moves upwards
Put it on tick
You can also use a timer, but if you want it to smoothly move, then putting it into tick would probably make most sense
What am I missing here? Why isn't Unreal showing me the real values? Just hovering on the lines doesn't work either...
Because the BP debugging functionality is finicky
and sometimes just refuses to show you anything useful
hey quick question, I come from Unity and was wondering how to reference a Camera (or any other object on a level) directly from a Widget, without having to have a GetAllActorsOfClass. Is that possible?
GetAllActorsWithTag ๐ฏ
There is a stream pinned to this channel about blueprint communication
There are few classes that more or less only exist once
Like the GameState
Those are accessible from everywhere โข
So your actor or camera can always get the GameState on BeginPlay and add itself to it as a pointer/reference
Or to a component that you add to the GameState ( to keep things more organized )
Your widget can then get that reference from the GameState
lol
this seems backwards... ticks are frame based, timers are time based, I get more fluid movement from timers then ticks.
Timers are not guaranteed to run at the exact interval
Ticks are indeed frame based, the common method to address this is to multiply movement or other such values by deltaTime
nothing that works with floats is guaranteed to work on exacts, as Unreal puts it 'Floating math is complicated'.
sure if you wanna use timers then go for it ยฏ_(ใ)_/ยฏ
it is additional overhead on top of ticking, and if your framerate fluctuates enough that a single frame takes longer than the timer interval, you will get jumpy movement
and as you said, you can always use delta time to adjust with either method.
if you're going to use deltatime anyway then there's very little reason to use timers
not true.
yes?
again with timers you have more control then with ticks. a timer can be setup, destroyed, paused. ticks can't.
Ticks can be paused
the only real time to use a tick over a timer to be honest is if you want to use it for something thats constant.
What do you mean by constant?
๐
Like.. constant movement? Like when you want to move a character?
if your using a tick to control your movement your doing it wrong.
how do i make it so i have a slide show? or a simple back forward system?
the tutorials online dont work for what im trying to achieve
Cool, I guess all folks at Epic are doing it wrong then because literally everything related to movement in the engine runs on tick
time line animations?
never worked with that
their animation graph yes, which is right, character movement in the bp no, which is wrong. I like how you misdirect, good job!
but to be fair this is also my first day with blueprints haha
cant i just add a node that tells it to move x amount of pixels up or down?
that'd fall back to this arguement the zomg is having with me, you'd basically want to use a lerp with delta time on a timer to move by pixel. he'd probably tell you to toss it on a tick.
you can do it whatever way you want but let's not go claiming that it's wrong to do character movement on tick :P
no your taking constants and trying to use them as examples to prove your point to use ticks for everything.
Where did I say you have to use ticks for everything?
You're the one who said that character movement should not happen on tick, and yet the character movement component (and all other movement components) run their logic in tick
so feel free to explain how Unreal Engine is programmed incorrectly
but stop putting words into my mouth :P
I'm all ears, please do explain how I'm wrong
I'm serious, I'd love to not use tick if I don't have to
im serious as well, im done being trolled.
lol okay
This depends on what you want to do. A timeline would be a simple way to move the slideshow at certain speeds
again. ... wrong....
Yeah that's a valid alternative
you know, UE made those learning courses for a reason Zomg.
I'm agreeing with you, why are you like this?
just saying...
Saying what?
All I said was I made a suggestion to use tick, and you're just gunning for my head now
no i just pointed out you were wrong about the speeds.
No you've repeatedly called me incompetent at this point
Is suggesting to use tick such a giant faux pas or what?
never once used that word.
You also suggested that I was trolling because I made the suggestion to use tick
Again for no reason
no i said you were trolling me. not because of a suggestion. you keep twisting things, common thing a troll does.
Yeah you kept attacking what I said when it was simply statements about how UE works
lets agree to disagree.
here we go again....
Hello, Im new to UE and I'm just getting into Blueprints. I have a problem where when the player enters a trigger box the 1st time its firing both the enter and exit nodes at the same time. it fixes itself when i exit and enter the trigger box again, am I doing something wrong?
Go on, I love watching bar brawls.
Yeah I honestly don't know what his problem is.... I'm just trying to help people and he just starts attacking me :P
think you got that backwars zomg.
Do you think maybe you guys can just let it go?
Not sure how that doesn't work...
Character consists of multiple colliding comps so one triggers entry and one triggers exit?
Not sure tbh
Don't. I want to watch a bar brawl. I'm putting the bet on the last man standing.
do a check to keep the component from double firing:
doing something similar can keep you from getting a begin and end overlap at the same time.
I'll give it a try. Should I just put those two nodes after each then? Like i said im brand new to BPs (just started yesterday)
what might be happening is if your actor is holding something / has a secondary component, that component while walking in may be going outside of the box as your characters triggering it. If you check for something specific when something overlaps / ends overlap that can prevent you from getting both a begin and end event at the same time.
this might help, a tutorial on doors by itsmebro:
https://youtu.be/oWHHjivvK2s
In this video we shall create a door actor that our character can interact with to open and close.
Join our discord: https://discord.gg/Gr9sPP2
Free assets: https://itsmebro.net
Donate: https://itsmebro.net/donate
Patreon: https://www.patreon.com/ItsMeBro
Its just the default 3d person rig. The strange thing is it was working just fine, then I added a collision box to the door because he was able to run right through it. Do you think the door is interfering with the trigger box as it runs right through it?
*runs right through the trigger box
also thanks for the video, I'll check it out. I was cobbling bits of videos together to figure out how to do this
if he was able to run through your door it sounds like your door itself doesn't have any collision or its set to ignore collision.
I find using tick for movement is perfectly valid, as you point out so does epic, CMC and whatnot.
correct, so I added collision to it by editing the mesh and adding a collision box. Thats when it started acting up.
yeah the videos a full tutorial series, should help give you a better understanding so you can make your own doors or even more advanced.
@gentle urchin yeah, it is the standard way of doing it in pretty much every game engine I've ever used and in pretty much every game source I've ever seen
so your door is triggering your trigger and firing the end event then i bet
thats what I was thinking, however it starts acting correctly once i enter and then exit the trigger box for the 1st time. I'll watch the vids, but if this is the case, do you think adding two different trigger boxes on either side of the door would fix the problem, or is it adding complexity for nothing?
you could try.... setting the collision of the trigger box to ignore all except pawns:
I'll give that a try
simple doors i just use a single collision box:
yea thats pretty much how mine looks
my door never actually overlaps the collision box itself, the collision box is just slightly larger then the door for both closed and open positions.
Yep, setting the triggerbox to only pawn seemed to fix the problem, so the door itself must have been causing the issue. Thanks for the help! and thanks for the vid!
im betting something like your handle was going outside the box ๐
I had it enveloping the whole door by more than enough when closed.
more complex doors, like say.....
Door simulator
your going to want to use the first method for begin/end events (checking against whats triggering it) rather then only using the collision.
Yea, I'll have to figure out more of these nodes eventually. Unfortunately a lot of tutorials online seem to say 'add this node' but dont explain why or what the node actually does.
ItsMeBro is pretty good at explaining things along the way, only issue i have with his videos is they move abit fast at times ๐
Cool, I'll try to check out several of his vids and see if they help. Thanks again for the help.
That's interesting, I never had issues with components overlapping other components on the same actor ๐ค Good to know it can happen
seems more common with multi part static actors.
I'm very close to pulling my hair now, I think...
Just a tip for that
Instead of Length - 1 you can use Last Index
huh... that's cool... still, I don't think that's why I'm missing 3 iterations ๐
is there any reason you're not using a ForEachLoop
yes? I want to run a very specific number of iterations, not once per item?
you can also get that same behavior with ForEachLoopWithBreak
What are you trying to achieve
I'll be honest, I don't know how macros feel about having a variable inside of them that can be set out of their scope
I also think you're better of temp saving the removed ones.
so I would try passing the array as a parameter first
then removing them afterwards.
are you sure the loop is only cycling 5 times? technically it should be cycling 9 (0-8)
- last used index
alternative solutions are great, and I guess I'll try, but I'm super curious as to why I'm seeing what I'm seeing
whats the incoming value?
You are modifying the last index each loop, may explain it
you could very well be trying to remove a invalid index....
it might be that scope thing I mentioned
what the heck is that supposed to do?
What are you trying to achieve is the question
Remove a fixed amount of indexes...
That will give answers
from a desired index
when you remove you have to run backwards on the array
the array is always 10 items, but a lesser number is often used... so I want to remove those which aren't (except the last one, which I always want to save)
The array updates when you remove from it
and why do you start at 0 if you want to just remove a specific amount?
So when you remove index 0, the index which was 1 now becomes 0
the range is quite given?!
yes, but I'm always only removing the indexes after the ones I'm interested in...
the for loop is for a specific amount, isn't it? however... yeah... it might be calculating where it ends "live" so to speak...
yeah like Ben said, run backward while removing the index with a set number of items you want to remove. rather from 0 to 8 you'd go 8 to 0 that'll keep you from trying to remove a invalid index.
let me throw a cache in there
don't go from 8 to 0, go from last index that you want to remove to the first index that you want to remove
well i was going by his sample pic ben
ok, cache worked!
my math is shit, but now I get the logic at least and can fix the math ๐
you can try hard to make this work or just pick the elegant solution xD
so reverse for each? but it adds a lot of nodes to count down, won't it?
also last index changes every time you run the loop body if you keep removing stuff, but im not sure if that contributes to your problem, because i dont even want to try to understand it fully ๐
Not sure if this explains it very well but
makes sense really
Starts with array of 10, last index is 10-1, removes 1 from the array, and 9 elements remain
after 5 iterations, assuming in scope, leaves you at loop end.
cant recall if theres a separate backwards for loop or if you can just use a higher start value and lower end value to archive the same
you'd just need to make your own for loop, no backward running ones, original is:
I need some time to wrap my head around that one ๐
Mine does seem to work now though...
there is a reverse for each, just not backward for loop. only difference would be you'd subtract instead of add, and check to against first index instead of last index.
Generally prone to errors when removing from an array you're using as the loop condition moving forward. Many pitfalls. fewer going backwards
Still i wonder if this dynamic approach in general has a gentler solution to it, but that's your call in the end
I totally get that, but note that I'm not increasing the index that I'm removing! I'm always removing the same index in this case.
I'm also not looking at any values in the array, because I don't care
True, and i can only assume you validate the incoming index aswell
yes! (from a switch on an integer, always between 0 and 9)
right, so even when starting later, you'd just quit sooner, so no biggie
well this was fun, thanks everyone! ๐
What's the best way to manager character customisation? think runescape character customisation kind of stuff, what i mean specifically is being able to change your legs, torso, stuff like that. I don't understand how you can split mix body parts to make a proper character.
I didn't explain that well. I'm just not sure how to seperate a character into seperate sections, torso,legs, arms etc
modular, thats the word I was after! thank you so much
is modulation a cause for performance issues? i imagine it would cause issues instead of being one solid mesh
I wouldn't worry about it, sounds so minimal
the docs go into performance
it's a VR project, so anything minimal tends to make a difference i find haha
scroll to the end, there's an overview
depends how many players are in the area
also with mesh merge you pretty much get the same performance as a solid character mesh
Why not replace the branch with IsValid?
The branch works and the remove from parent is called
Though good idea
Nay, it's the best practice.
Validate Get could work too?
And use the given ref directly
iirc it's more performant too
If I have a blueprint function that returns a value, but there are some paths in the function (like a branch) that doesn't return a value at all, and I call the function and it reaches the path that doesn't return anything, will the node that is executed/connected after the return-less function call be called?
Yes
Yeah
And itโll return the default parameters
May be best practice to have a return for clarity anyways imo
It's good design to make sure all your codepaths return a value so it's not unclear what is returned when
https://youtube.com/watch?v=nc7F7IJLuik&feature=share (I tried this but i still canโt pickup my weapon) help me please
Check out my Unreal Engine 4 courses right here: https://devaddict.teachable.com/
โบSubscribe here: https://www.youtube.com/channel/UCGxt9c_CREmnquHjPEknHYw?sub_confirmation=1
โบBusiness Email: devaddictiscringe@gmail.com
New here? Start at Part 1: https://youtu.be/maG2YnVnIVM
Welcome to part 3 of my Multiplayer/Coop Survival Game tutorial for ...
Yep
We wonโt go through a whole tutorial to check where you did wrong. What goes wrong and show us the code where it goes wrong
๐๐ป
hey peeps, are there any nodes to convert a color/linear color var to a hex string or somethin?
i still cannot pick the gun up (Survival_Player = the character)
@snow halo there should be a linearcolor -> hex node, if you drag from the color pin and search for hex you should find it
Not seeing anything
That's odd...
This.
I get quite annoyed when people ask other to watch through the tutorial and not directly showing the problematic code.
Ohh sorry my bad, the function is from a color wheel plugin I have :P
Are you testing on a server?
Cause that RPC is giving me depression
no
I bet it's not working cause Pickup has no valid ref
okay, how should i fix it
How are you setting Pickup
Let's do this to test first of all
Then press the Interact button
i deleted the GET pickup node
so everytime i press E the weapon attach to the character
As it should, no?
First of all, donโt multicast spawn actors
Core of the problem is that he's using a Pickup Ref, but not actually using it
Probs not even setting it right
So validate failed
oh oke
Many issues with this code. Iโll join in when Iโm home
Yeppp
This is fascinating... it works outside of the function, but not inside of it...
Trash the blueprint debugger
You don't say ๐ญ
Yeah breakpoints and stepping is the only thing that works sorta reliably
but... I am using a breakpoint...
Hovering over pins to see their values shows nothing useful more often than not :P
So it's entirely possible the value you see is wrong
I would use a print if you really wanna see the value itself, only reliable way i found, but gets messy, lol
Then remove it after you're done if it's just a one time thing
Yes, but hovering over variables is buggy
Unreal Engine... debug like it's 1985! Woo!
Unreal, right?
Truly the future of interactive entertainment...
As if Unity did something different in this regard...
I used Unity up until 2017... you could watch all values LIVE in the details panels there... here, shit just freezes up
no... again, not while stepping through a blueprint
Yea no
Probs broke it more
btw it works 100% of the time in C++ :P
Usually works better with anything else than references
Did someone say Rider??
Notepad all the way
I think I misbehaved in front of one of the Rider guys yesterday ๐
lol
It's a love hate relationship
C++ in unreal is not that annoying. Epic has macroโed the shit out of it
Imagine saying "Sorry but I use Visual Studio all the time because it's free" in front of one of the Rider team member.
there are worse things than working with cpp
like trying to help people in a BP channel AYOOO
Yes: working with Unity.
GOT EM
I have a blueprint for a trap i put in my game, however I placed 3 of those. Is there a way to get each instance of that class that is placed in the world?
working on someone elses structured text code, where they used 99% pointers
Like, it's Trap_BP, but then there's Trap_BP1, 2 and 3, is there a way to get each one?
get them where?
Get All Actors of Class
Just don't do it every tick.
Hey guys, is there a way to end my scene after a certain amount of time in my level blueprint?
what's da plugin?
I have a button which disarms the traps, however if one of the traps was already activated/destroyed, i get an accessed none error
Define "end scene".
use the level blueprint
do you have a OnPressed Event in the button?
I mean like when I hit the play button I can make it so after 10 seconds the scene will stop playing
@snow halo uhh I think it's called color wheel or something, there's a couple of them but it's the free one
Sorry no, not accessed none, its "pending kill"
Yes
?
that means someone already killed it
show me your logic
Are you referring to Level Sequence?
Yeah, if I trigger the first trap, the trap gets destroyed. if I then press the button, whch is meant to kill all 3 traps, it gives me that error
hmm I dont know the right term for it but I mean when I try playing/simulating my scene. Im trying to set something up in my level blueprint so that the scene will end after a certain amount of time. Not any sequences or anything
"scene" is a vague term, as far as general logic assembly goes.
Thats why I was wondering if there's a way to check and only destroy the traps that are still active
Check if they're valid?
But it all sounds like a design issue in the end
Yeah sorry haha. Like when i click the play button next to compile and launch. I just want the scene to automatically end after a certain period of time
make a check first to see if each trap is valid
and only kill them if they are valid
show me your logic
sec
there are many ways of doing just taht
Just depends why you would want one instance and how do you want to get it
get all actors of class is the cheat code
I don't recommend using it unless it's a quick and dirty prototype
Overlap is a pretty straight forward way to get one instance
Subsystem gang 
I placed the 3 traps like this
They're all the same blueprint
Idk im new to unreal ๐ฉ
Ye
because on the video
if i get hit
and then press the button
it also tries to kill the 1st one
but its not there anymore
because it got destroyed when i got hit
Well
I guess
this is very no bueno
Part of the problem is that you kno
xd
You have it in BeginPlay
Just GetAllActors when you press the button
After the DoOnce
Oh that fixed it
Cause if you get at BeginPlay, still holds a ref of the already destroyed one
wow
Yeah makes sense
that makes A LOT of sense actually
holy shit
Thanks
I only have 2 weeks in unreal so Im trying
Thanks boys
Everything is too big for discord when you need it
Oh wait I can send it
itch.io or GitHub releases.
This is still really raw so bare with
The main goal is to have a Shifting maze
meaning whenever you die
it changes to another layout
but i only have 1 layout right now
well, kinda... as long as you dont press the button 4 times
or there are more traps in the level
This video was before the new traps I did this morning
Ahh idk then :((
Aye, looks good for that amount of time!
Ahh I see
Do you place the button and traps or are they procedural?
Cause you could make an Array of Trap Actors, Expose it on the Button and assign the traps to the Button Manually
So you have a hard link between instances
I wanna have 5 layouts for this "biome", and I want to make the first one really hard, so it forces the player to die, and cycle through to the next layout upon death, if the player keeps dying, it'll keep cycling through the 5 layouts until they learn it and get through to the next biome, which will also have 5 layouts, and so on
ooo
which is a step above get all actors
If they are manually placed like he said, it should be no problem if random generation is treated like prefabs
Yeah idk how to do that xd
So your traps have a BP no?
In your button create a new array variable of the trap type
Literally create a new variable and as the type use your trap bp name
nah, people give level BP too much flak
and others overrate it
level BP is arguably the best OOP way of doing it
self registration is ECS god tier
You mean like this? @dark crow
