#blueprint
402296 messages ยท Page 803 of 403
if you want to make a difference in this kind of behavior, change your used assets. because you're not going to change the renderer
Good general rule is to not try and out think the compiler. The engine has built in ways to handle culling things. Just play with those rather then try to make your own system for it
how would I go about that ? Because the only thing I'm thinking about is the suggestion said above like having each cube being 6 different planes and enable/disable it depending on other faces next to it
If i'm asking too much then please say, but if I understand you correctly, instead of casting or using an interface, if I for example need to at one point access a variable from a different blueprint I can use the soft object pointer to that BP, which would let me access that variable?
If it's not ever gonna move then you can make them one asset and just not have those faces otherwise I really wouldn't worry about it
how can i trigger a volume on spawn?
it won't even recognise the player even if i check for it in begin play
with get overlapping
What I have right now is literally a begin play, in multiple BP's, each having between 5-7 casts to different bp's, and I save the reference and then use it troughout the BP
race conditions
damn
no I mean, what type of projectile? is it a bullet? is a ball?
overlap or hit both work
generally a delay is a really hacky way to do this
what would you do?
create a callback from the player character when it has spawned
for every volume of type? ๐ฎ
and use that to bind to an event that has your overlapping logic
you make a base class for your volume types?
yeah
i would just spawn the pawn else where and then set location to the starting point ๐
use hit then
doesn't matter where it spawns
the issue is you don't know when it spawns
it could spawn before or after the trigger spawns
You don't use SoftObjectPtrs for most framework classes. You use them to minimize the assets that these framework classes can load. You can hard cast to five thousand small classes that don't use heavy assets and not really notice anything. Consider a game like Overwatch remade into UE4. Have a default character class where you do a lot of logic. Reference no assets here. You can create empty asset variables like particles or skeletal meshes, but do not set them to anything. No you create a new character class named a Reinhardt. You set the skeletalmeshes, and particles. Maybe add some extra constant particle effects in the designer view. You now treat this Reinhardt class as an Asset. You NEVER cast to it anywhere, you don't specify it in hard pointers this is the class you use as a soft object reference in something like a picking menu. Meanwhile, you entire game logic just casts to the base class. You can access the variables that the Reinhardt inherits and affect them without ever casting specifically to that class.
You can do this by turning actual Actor or Character classes into asset like classes like this, or by defining defaults and loading them from datatables and such.
So it's always recommended to have a base class, even if it only has one child character?
you don't know that you're only ever going to have one subclass
and generally, you have multiple
a door can slide open or it can rotate open
Depends on how you set things up. You don't need one if you're populating it correctly. But if you like the designer tools and plan on making multiple children classes with different things you should always have a base class usually.
not necessarily. and even then you would still have AI characters potentially
NPCs etc
yes, block. you'd still have to generate hit events, but you wouldn't need a new custom collision channel
not having one is a surefire way to increase tech debt
That makes sense, I think I have everything setup the wrong way then considering It's a singleplayer game with only one character (and no AI), so I have a BP for that character that has alot of logic, skeletal mesh, etc, and I cast to it in many other BP's
I have three. ๐
What you have is fine. The only time you'd have to care about soft object ptrs is if that one character can swap cosmetics.
Mind you. Smaller projects are somewhat exempt from this. But it's something to always consider for scalability. You don't know where your project will be by your third DLC. Nevermind if you keep the same project and expand it for a second game.
I see, I have that too where I change the material of the mesh of the character, and I do this by having a reference (already hard casted) to the character, I get the mesh and I set a material to it
Yeah It makes sense to do things the right way from the start incase it keeps growing in complexity
yes, but enabling hit events doesn't mean you have to do any logic on them in the mesh itself. you can do all the logic from the projectile itself
generating hit events just means that the other object will respond to your projectile's collision query
if you mean this, that is for physics interaction
it's not
it's for generating hit events
the Event Hit
without it you cannot query collision
you're misunderstanding what I am saying
you will not get the Event Hit if you don't tick that checkbox
and that is still a collision query
Consider this for example. Either of these would load a random mesh from this array into memory, and then set it on the mesh component. The rest of these meshes are just a very tiny little FName variable sitting there waiting to be used. Calling this a second time would release the first set mesh, and let it be garbage collected at some point and load a new mesh and set it.
depends on how you move things i guess
yes
that toggle is really just for physics interaction
tick?
Thats interesting I have a better idea of how to go about this now that for all the explanations
if you have physics, then you need that toggle to be on
well I stand corrected
just tested it
it does not seem to work for every asset
in fact it only works if you use the default collision preset
is there a way to say "the closer a 2D vector is to another 2D vector - the closer it is to 1" ?
for direction or location?
for direction you can use dot
nvm, i figured it out.
after 3 days, i finally solved a problem

brb, getting alcohol.
how do i find an actor that spawns in the world?
This requires context. Which actor? There are many different reasons that actors are used, some of which aren't actually visible.
I want level blueprint to grab the player on event begin play. after the player spawns.
is there any reason you are doing whatever you're doing in the level blueprint here?
College student? ๐
level blueprint puts player in and out of vehicle.
sorry Poses
you can always get player character 0 if its already possessed but hmm
Is this for a college/university thing? If not, I strongly recommend ditching ideas about the level blueprint entirely and learn how to do stuff in the basic framework(PlayerController, PlayerPawn/Character, etc)
can i put player in level bp on player start from player?
may i know why the level bp?
The college question wasn't a jab. ๐ I don't know why, but college teaching has a seriously bad infatuation with the level blueprint. Screw OOP, just throw it all in the level.
level blueprint is part of the OOP
i watched a tutorial and it used level bp. but in another tutorial it recommended not using level bp for anything if at all posable
it's a manager for all the actors within the level
perhaps with the exception of the player character
basically,
Yeah, but like in a lot of cases, they teach to put controls and such there.
that is nonsense yeah
They just dump all of the game's logic in there and treat it like a central place to just grab everything.
Easier for people to start learning with I suppose? Not good practice at all.
I can see the case of having a vehicle level where the player starts inside of a vehicle where they otherwise wouldn't be inside a vehicle
but if it is a systemic action, it should not be in the level blueprint
i should move everything into the player bp?
Are you trying to make a character get into and get out of a vehicle?
player buys a vehicle, can get in and out of vehicle. vehicle can be damaged and destroyed.
I don't think so its only a mode of storage and transportation.
so then if it has nothing to do with the level, then you don't need the level blueprint
To explain why you should avoid doing things like this in the level(And a lot of other things). If you ever decide you want a second level, suddenly, you have to redo all of this logic even when you use the same character and vehicle.
what about checkpoints and respawn points in the level?
like precaudal level generation?
I'm guessing that all goes in the level bp
depends
That can be in the level, sure. Also depends though. Sometimes you make separate actor classes out of your spawning managers and drop them into the level to do their thing.
if checkpoints are all the same, you can make an actor to house that logic
consider it for unique circumstances
like if there's a special thing that happens
like a bridge that breaks down
that goes into the level blueprint
I need to look more into this, sounds important.
idk what you would put in level bp then.
You'll learn about it soon enough. ๐ It's pretty common Unreal practice to expose variables on an actor, drop them into a level and use that actor's construction script to alter it while it's in the level to see it in action. Pretty typical level designer stuff.
the only time i would use level bp is where i would need some actor reference from the level directly that otherwise i cannot get anywhere else.
and also that level exlusive
like a public static world variable?
not sure what you mean by a world variable if we are talking about blueprints ๐ค
short answer: nothing
long answer: unless you're a level designer don't use the level blueprint
if you had AI patrol points for instance, those would be in the level blueprint
and they would be setup by the level designer
I get the impression that is more for multiple levels that have level specific differences.
It's just a simple matter of DNRY practice. Doing gameplay stuff in the level means you have to repeat yourself on another level.
what is?
level bp?
this is why the distinction between level unique elements versus systemic elements is importnat
yes that's wat I'm saying
welp my splashscreenlevel is done using level blueprint spawning the widgets and thats about it
๐
when talking about design, there are generally 3 (4) main paths: systems, levels, technical (and UI, if you count that)
Hi UEers ... which is better performing in BPs: Enums or Gameplay Tags (assume fast replication is enabled)???
I could not find an answer from online searches. Thanks in advance!
systems are for the entire game. they are repeat actions you can do at certain times during the game. they have nothing to do with where you are when you do them. example: picking up items, health and damage, attack patterns
levels are where the actions happen. level actions are usually unique and tied to the location. if you have a specific building that collapses only in that level, then that's a unique circumstance that happens only in that level.
@void night This has no bearing on BP. Enums are a single byte, GameplayTags are serialized into about the same with fast replication depending on the tag. So it's mostly a moot point unless you're talking hundreds of them per second all game long. The only real consideration is processing performance of packing/unpacking them, but that's not a really valid consideration until you hit an extremely large number.
TY Authear ... I was also considering related performance points like a tags don't work off of a select, but enums do, so that would require one extra node to use a switch. Again, in low quantities of use not a factor, but still factored in.
OH NO! DONT LOOK!
I accidently put a hamster in the level BP
That's what you get for using level bp
Actually fun fact. Switches are faster than selects in a lot of cases. Selects require the processing of both values and any pure nodes attached to them to run before the selection is done. Switches just change execution order and can do a lot less processing.
Or in other cases where one might have 2 enums (like for a Type and SubType thing) to process, where as one Tag could be used.
I was not aware of that ... TY for that additional info.
yes but branching eww
not like it matters in BP
Whenever a Pure node runs, it has to collect all of it's parameters before it can execute.
It's often faster to do more work and throw some out than to branch
then or than?
but we're here in BP land, YMMV
yea, same applies to a bunch of things, also the AND node (and all the other boolean operator nodes)
where in c++ foo() && bar() would only execute the first, in BP it will execute both (if the first is false)
Sorry to interrupt.
quick question.
How do i group variables?
Category on the details panel
in the details change their category (you can enter new names in the same field)
Thanks ๐
thank you
is this better? its all in the player. Note: Vehicle only handles the transition proses.
Can I get the Component I'm attached to (as an Actor) when attached via AttachActorToComponent?
I see GetAttachParentActor, but nothing about the specific component
you can use GetAttachParent from the root component of the actor
GetComponentByClass
oh, that worked. ty!
It has a misleading description, though
everything you see on the side of this menu is a SceneComponent
oh, right. I confused it for scene root
if you attach something to a component, you can imagine its like being added to the hierarchy
the highest one in the hierarchy of the blueprint is the Root Component of the blueprint
everything above the bottom line
within the 2 lines to be exact
ActorComponent != SceneComponent
oops
im using this blueprint to make one of my turrets to fallow the camera of the vehicle when im aiming at the location it works fine in the yaw but in the barrel the look is inverted so when i look up the barrel goes down. How do i correct this? is is it in the camera properties or can i do it in the blueprint
how are you setting up your input?
shouldnt you set pitch instead of roll on the barrel part?
I find it pretty weird that you're using an axis for an InputAction, instead of binding it to an InputAxis
its usable but hmm it should work just fine for the press and release
i did change to pitch but still same problem the pitch of the barrel still looking inverted
What if flicking it across center counts as "release" for the inputaction?
i did tried, it dint, on 4.27
for the barrel part, it should be just this?
Well the other advantage to using input axis instead would be debugging. They could put in a print and see exactly what the axis value is at the moment it mistakenly fires
you can put both to try i guess
yes that did the trick, Thanks a lot
can anyone help me im new dumb and literally have been trying to figure this out for 5hrs
Im trying to stop aiming when i sprint
create custom event, link it to the same logic as rmb released and and call it on shift
@wide linden
When you sprint, whatever sets your sprinting values should set aiming to not true.
so sprint is set by walk speed but in this i cant make anything for max walk speed
i suggest you separate your event clearly
didn't you leave the server?
i wouldnt suggest using flip flop haha..
i get an error saying UE4asp is not compatible with Test Object Reference
its there a common fix for that by any chance
Where do you see that
can you screenshot your error?
ok wait
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Or that
click on your InputAction
Click on the inputaction
One message removed from a suspended account.
here
so I'm thinking that whatever UE4ASP is, it isn't a character
it just means 'player'
well it isn't
One message removed from a suspended account.
@maiden wadiwas just wondering if you could shed some light on this, I'm currently hooking up get player character (there only will ever be the one) directly to my function, this is better then if I casted then fetched the function correct?
can you give me the parent class of UE4ASP?
One message removed from a suspended account.
its a default asset in the third person template
right okay
im new to ue5
One message removed from a suspended account.
its a player as far as ue5 ssays
oh
but assuming this is new to UE5, you may be trying to cast up
Casted one will result in a hard reference which invalidate the use of interface in the first place, if you are wondering about performance, i believe in this case they are both about the same.
So I guess it's just inevitable then, when theres an "other actor" like a trigger check it's very easy but when there isn't I guess I have no choice
if anyone needs to know how not to stop sprint when you are ads let me know
@glossy baneThere is no difference between these when the interface calls to an object that is already loaded all of the time. In fact the interface is harmful here. It's an extra class, and more work to implement it into the character class. Also it's barely distinguishable, but interfaces are much slower than directly calling after a cast.
Right so I should get rid of the interface and just create a function and call it directly. And in regards to getting player character/casting I'm assuming it's just inevitable when I need to be fetching a constantly changing var
If you need just the player's yeh, store the ref too
Hello! I hope someone can give me some advice on the correct direction for a RTS map generator. I'm currently working on level generation for an isometric RTS and I need a method of generating levels. The map needs to work on a grid, but I'm unsure whether to create Level instances with their own tile generators / scatter generators and then instance these levels. Thoughts? Thanks you!
don't know how much of that is possible in BP
I know there's a perlin noise node
but how that works with actually generating landscapes
should I head over to ccp?
maybe out of reach
@oak daggerTake a serious look at Prefabricator plugin. It's fantastic for this sort of thing. You still have to do the generation on your own, but you can create prefabs, and also randomizers that are extremely easy to use.
Yeah, I really want this to be proprietary as I find making things from the ground up easier to debug and fix
a fellow NIH
I can respect that
#cpp is probably where you want to be
perhaps it could even be
a subsystem
gotcha
Thanks!
There's really no upkeep to it. If you're lazy like me, just make a BP library function that precasts the pointer for you to your BP class. Getting the player character is extremely cheap. I'd only bother caching it for a large loop or something.
Is there a way to optimize large code blueprint?
I guess you have to balance between runtime performance and referencing issue
I have a blueprint, and it takes 2-3 minutes to compile
move it to cpp ๐
but otherwise, split it up to different classes
The issue is only to fix compile blueprint speed. Everything works fine
if one blueprint is taking that long
it sounds like it's a god entity
which is a big no no
I see, but I think I'm missing something fundamental with casting; If I have a cast to a BP, for example my BP_Character, does it matter how many casts I do to that BP? Like, if I have 5 other BP's that each have a cast to BP_Character, and I find a way to get rid of 4 of those, but I still have one that is casting, has that made any performance difference or is it like if you cast once it doesn't matter anymore if I cast more times in different BP's?
As long you are not casting every frame, i think it should be fine
yes but equally no need to do 4 casts when one is enough
Right so it's worth taking the time to reduce the amount of casts even if I still have one or two that must have it
casts cost a little more than a branch atm
If you know you need the ref alot in the bp, you can cast and store it for use
Hello everyone! I am having a bit of trouble with a simple high score save function w/ blueprints in UE5 and was wondering if anyone would be able to help me figure out where I'm going wrong with it?
Yeah I'm just trying to figure this out cause I'm casting to a large BP with loads of variables and functions etc
you should not have a large BP
it means that somewhere something has too much responsibility
Sounds like you need to make a struct that carries that information.
Yeah it's essentially what im trying to fix, im moving logic out to different BP's but that forces me to cast back to character
consider the player character more of a manager of its components
So its like, does moving logic out and casting back yield anything or is actually harmful lol.
Sometimes the BP thumbnail becomes super zoomed out
Has anyone experienced this, or knows how to reset it ?
save your character to a variable
you can right click and there's some thumbnail options
Hi all, what would be a good way to detect if a player starts the game within a sphere collision of an enemy, and to run the code you would expect had OnBeginOverlap been triggered?
Is there anything to continually check if something is "inside" the collision volume?
in the content browser?
view options > thumbnail edit mode
not sure where that menu is
don't think there's a better section for it
looks like this is just for rotation, not zooming in/out
odd
๐คท
does anyone have any good tutorials/a good general idea of the best and easiest way to do a radial menu i can add things to at runtime, and can detect which option has been selected?
not sure of any tutorials. I would probably recommend a plugin over doing it yourself generally. I did one and it was a pain in the behind
any specific plug-in youโd recommend? or just any of them
I would never recommend a plugin, and I don't know any. like I said I've made mine myself
gotcha, thanks for the help
go for a free one if you can
worst case you can lift the code as a springboard for your own
There is a disconnect between "performance" on this topic that needs cleared up.
CPU:
The simplest is of course CPU. For CPU performance there is a very tiny small cost when casting because it checks validity too. You can do thousands of these a frame most likely and not see an FPS difference. This kind of casting thought is worth ignoring entirely.
Memory:
The second is memory. To understand how this works you have to understand what a class CDO is. Class Default Objects are a default version of the object that Unreal creates in the background when that class needs to be ready to be used. You have one of these for everything you create. You can think of these as the purple class variables you have in blueprint, you can't really get anything out of them except for class defaults.
When you instantiate a new character, you're basically creating a few variables, you're not actually copying all of the functions and methods and everything else. That character's instance exists as some values in memory.
So you have 3 actors in a level based game.
PlayerCharacter
BossInLevel3
Apple
You have decided that you want BossInLevel3 to get confused when PlayerCharacter consumes an Apple. Also Apples don't exist until level 2 and onward.
You've decided to cast to Apple and use it in the PlayerCharacter. Next in Apple's blueprint you cast to BossInLevel3 and call a function if it's valid.
You start up level 1. You GameMode has a class value of your PlayerCharacter set in it's settings to spawn this character class when a level starts. So your world goes to spawn the GameMode actor, but it needs the Character. So it loads the character into memory, but Character has casted to Apple. Apple gets loaded into memory. Apple casts to BossInLevel3, BossInLevel3 gets loaded into memory. Now you can SpawnActor that Character class in level 1, where no Apples, or that boss exist.
I have to stop writing essays in here, I'm going to get banned. ๐
a link is also fine ๐
@bright harborI detect mine with a FindLookAtRotation from GetMousePosition translated into the local space of the radial menu via it's cached geometry with the FVector2Ds converted to ZeroZ Vectors. You can use the Yaw to detect which direction the cursor is in relation to the center of the radial menu that way. 0 is straight right, 180 is left, -90 is up on screen 90 is down on screen. You can use that by dividing and rounding it to get array index locations. And Add the stuff you want to select to the array and populate it on screen with that logic in mind.
I would recommend going out and taking a look at object oriented programming
understanding that is key to making good blueprints
specifically, polymorphism and hierarchies
I'm getting this error but don't know what's the problem with my code when trying to add a widget BP to the screen.
That cleared up a lot of confusion thank you. Looking at your example then instead of casting to Apple and BossInLevel3 somewhere in PlayerCharacter, that cast should instead be controlled by a condition, for example I could still cast to Apple in PlayerCharacter, but only after player has loaded up level 2, and then I can cast to BossInLevel3, but only once player has actually loaded up level 3?
@main lake You're testing with a dedicated server. Only reason that ever returns nullptr.
I set the Net Mode to "Play As Client" with 3 Players and Checked "Selected Viewport"
and is it ok or there's a way to fix it ?
Just finished my 6 week long oop course from school (albeit in Python) and it has helped but I feel like BP's hold my hand so much that it is so easy to neglect writing actual good code in regards to performance
Maybe I need to use the HasAuthority node ?
if you're new to programming python isn't a great language
I generally recommend very strongly typed languages for people who are new
something like java or c#
It's literally the only language they are teaching at my school atleast, but I see what you mean
Yup the HasAuthority node fixes it
@main lake This is one of the many reasons I handle all of my widget spawning through HUD. It's local only, has no chance of ever running on a server unless it's a listenserver with a local player.
There's also a check for IsDedicatedServer
Wait what do you mean ?
Because for me I create and add the HUD in the BP_Character
usually you create an HUD actor where you set all of your HUD stuff ?
AHUD, not a widget named HUD. AHUD is a class spawned and maintained by the remote version of a PlayerController.
is that something in C++ ?
No. Just having the cast node in the blueprint will cause it to be loaded. This is why you have base classes. Instead, Character could cast to Consumable, Apple could inherit from Consumable. Consumable could do all of the logic of the consumption. Consumable even with a ton of code is a tiny class, no meshes, no particles. Then the Apple would have an AoE affect. This could be something as simple as adding a damage type to the hit actors. Boss3 can switch on this damage type and start it's confusion. Everything else could ignore it. There are better ways, but this is one example of how you can completely disconnect these classes and keep the identical functionality without casting to them or using Interfaces.
You already actually have one that is spawning already. It's just not doing much.
Hi, How can i make it so my character rotate when its falling
Oh nice thank you, I learned something ๐ Now I'm gonna do all the stuff for the UI there ๐
I understand thank you again!
The awesome thing about this class is that one of them is spawned locally for each local player, and is not replicated so there is no networking in this class. It forces you to keep UI entirely disconnected and local only as it should be.
Also you can globally get it from anywhere with GetPlayerController->GetHUD
awesome thank you ๐
How would I check which actor of a class is overlapped?
get overlapped actors > foreach > get class
thanks
Where can I find get overlapped actors?
on whatever is overlapping them
a collision of some sort
bruh???
@odd ember One more question, why get class?
didn't you want the class?
like I was answering your question lol
and then you ask me "why do the thing that you said as a solution"?
Oh sorry when I said that I meant checking which actor
yeah... maybe itd be better to explain what your are trying to do
Im just trying to see which actor was overlapped
May be a dumb question boys but does anyone know the name of this โinputsโ node Iโm trying to follow a little tutorial but canโt for the life of me find it
what do you intend to do with that actor?
thats the start node of a function
or macro
Yeah so I am trying to create a function
See if its equal to another actor
in the bigger scope of things
what do you want to do
not your immediate next action
present your situation
sorry, do you not know how?
Canโt say that I do no.
thanks Peteh
Cool so just collapse to macro
When the player interacts with the trigger which is selected externally, I want to call an event, if thats in a big enough scope
*Key word being selected
there are multiple triggers
yes
That being said, I have to see if the trigger which the player interacted with is the one thats selected by an external script
which is where my problem lies
well that's different from what your asked initially
I don't know what you mean by external script
well if you're too lazy to type your answers are going to reflect that
what is the other blueprint?
The playerbp
While I can see how it'd be helpful, I dont see how that'd solve my problem?
it's a check if it's the player character overlapping
I don't know how you handle your selection process
Array
In the player bp
so now that you've cast to the player BP
yep
And check if the actor selected is the same one overlapped by the player?
Then that raises another question
Thanks for the help guys got it figured out appreciate it
Where do you get the variable for the actor overlapped or is it just this
this or self both work
probably? if you are certain that Selected Trigger works
also
no
connect the cast to OtherActor
Ohp just did that
is there a way to make get a boolean from anim bp to third person character bp?
or get a max walk speed over to the animbp
so they pass from bp to bp?
9hrs of trying to fix one problem
yeah
some of my variables dont show up in one or the other my brain is frying
ahhh
local variables
that could be it
how would i make it non local
i understand alittle i just wouldnt know how to connect it to what im trying to do ugh the is so tuff
ive watch 30 tutorials nothing to fix mine haha i think im fucked
This is how i fixed sprinting to aim but cant fix aim to sprint if that makes sense
so if you sprint and ADS then walk speed is set to 400. At the moment though if you ADS then sprint walk speed will go to max of 800 and sprint animation will start
Look into interfaces
You can create an event in your character BP and call it in your animbp
Oh nvm you have that part
i have il send
havnt started jump bc i cant fix sprint
everything works
let me send a video for whats going on
Today we show you how you can fix up our aiming system, ensuring that it does not let you aim whilst sprint or reloading. We also go over how we can make our cross hair disappear when aiming.
โบ Resources: https://www.devsquadacademy.com/resources
Unreal Engine 4 Beginner Tutorial Series:
https://www.youtube.com/playlist?list=PLL0cLF8gjBpqDdMoe...
5:40
but his fix doesnt work for me
or im dumb and cant figure it out
DevSquad
Welp...
so the biggest issue with his fix is that i dont have they same ads system mines animation based not camera
Get used to that for a while. ๐
lol
Id just set up a bool can sprint
If you cant sprint prevent the input from doing anything
yeah that worked for sprint to ads but not ads to sprint
or i set it up wrong
let me attempt again
Set it up so that when you start ads the bool is set to false
Well to make it more flexible
When you stop als you can set it to true
Just basically keep track if the button is pressed
And then you can do a boolean on top
So as long as you hold sprint, it will try to sprint until you let go
this is my aiming its in animbp
or should i try to do it in sprint
on thirpersoncharacter
thats my biggest thing to idk where to put this fix
Id do it all in character
You need to press something to aim right
Lol that was a wrong finger ๐
Branch after that
im melting over here
oh yeah fuck lol
this is it but only fixed the sprint to aim not aim to sprint
4 most used words by devs
so i have to do it in sprint right?
i dont have a variable for aim
fufuuffuuffuuf
asdl;fj;sd'
i have no idea what i got myself into
If you use tap to sprint, you can set it to false at the point it switches back to walking
Use some categories ๐
Btw I would start watching unreal videos on youtube
lol yeah
Or on the unreal learn site
Stats could be in a component, reloading in the gun
It'll teach you the foundations better than this
yeah im kind of just bouncing around atm doing this i want to do not missing alot in the middle
You're making stuff you don't understand atm (I don't want to be offensive but you'll have more fun if figuring out a branch doesn't take 9 hours)
And developing is so much fun
So I just wanna help you
thats true no offense im aware
And from personal experience I can also advise taking udemy courses if you have the 20 bucks. But I know not everyone agrees with me on this channel here so it's up to you if that fits your learning style you can always dm me if you want some good suggestions because there are trash courses on there too
It's basically a long tutorial with access to q and a
The one I followed is about 10 hours, took me about 50 hours to understand and play around with
But it really gave me a great foundation
And more importantly gave me knowledge on what I needed to learn next
Anything gamedev.tv is pretty much guaranteed to be good imo
uh so i have a landscape here and i built a navmesh volume which covers it. The navmesh built successfully but no green grids are showing when pressing p. On other surfaces the green grids show.
I followed a city builder tutorial when I very first started. Took me a week to finish it. Didn't have a clue what I was doing or why. Just followed along step by step. Went back through a second time around actually pausing the tutorial to think, took me a couple more weeks. Didn't change anything, I just looked through the types and googled what they were to understand the data flow and how what was doing what.
thats what i was doing with an fps guide have been through it 3 times atm
doesn't seem like a #blueprint issue. maybe ask in #ue4-general ?
The problem with YouTube tutorials is that a lot of them are in skill only just a bit above the level that they're teaching
so old ways of doing things
So they have a lot of bad practises
I dont wanna claim I don't but I don't make tutorials lol
yeah thats what it seemed like look like there where easier ways to do things or shorter
The problem I have with 99% of tutorials on youtube is them being step by step
Does anyone know much about how the air pathfinding works in UE. It seems ok but I do find issues with multiple units getting stuck on one another
Skipping actual teaching and explaining
*Ai pathfinding
the problem is also that most people on youtube don't actually understand what they're doing in detail. they use the cast node without knowing the implications of a cast etc.
how do i make booleans if there not in events
or should i say connect it to the animbp
is aiming is here but i need it on the other end you know
its in a category in animbp but how do i link it to the event graph
Promote to variable aye lets go
or is that rigfht
nope that didnt work
so you cant use variables from one thing to another ima drink my worries away il lurk the chat and try to learn
FIXED IT!!!!!!!!!!!!!!!!!
only 10hrs ;klasjf;k'l sdjf';gl ksdl;'fk sd'a;f
Oh is that all?
More specifically a basic patrol and attack ai
Not all of ai
probably not the right way but it worked
๐ I ditched behavior trees. I've decided I don't like them.
im not touching ai for another 6 years lawl
That branch isn't doing anythinf
i cant even get aim down sights to work lol
im so confused why you got a branch there
It also works without it
behavior trees are amaze
yeah branch not needed hahahah
Man I understood behaviour trees as soon as I stopped thinking of them as blueprints
thats good, as long as you're happy with it thats what matters! ๐ That branch isn't doing anything though, as you are checking if the bool is true or false, but you are not giving it a bool and have hard coded the condition to be true there so it is always true, ergo the branch isn't doing anything at all. Hopefully that explanation helps
im boucing in my dxracer ๐
I still don't understand why you didn't want them tbh, what was the issue?
yeah i though i would need to add a bool to the branch
but didnt need to
fuck
another problem now
so when i double tap shift it aims
99% of gamedev is running into problems then finding ways to solve them
its a pain at times lol
@dapper bobcat nah 99% of it is saying "i will do it after this tutorial" and ending up making an entirely doifferent game with 10 tutorials that dont match and giving up on the thing altogether
Also DevSquad is not a good tutor
Even as a beginner back then, I can't understand shit from his videos
I can't really say I relate ๐ but at least you made a game, thats an achievement all by itself.
@icy dragon hahaha aw man remember ember veins?
It was his project, eh?
It was weird mix of people and volunteers and it kinda disappeared
I dunno. There's just too much branching with so much copied logic everywhere. It feels frustrating for me to use when it comes to overlapping logics, and quite honestly I don't care for the rigidness of BTs. Varying tasks based on percentage is very difficult in comparison to a very simple Utility AI setup. Tom Looman has a post about it that kind of rings with my feeling on it. https://www.tomlooman.com/unreal-engine-utility-ai-part1/
Amen.
my character is locked to the X axis and I need it to move just along that axis and nowhere else. How do I set up the movements like that?
@trim matrix check out the character bp in the sidescroller template.
I mean I combine utility level stuff with BTs
I do think my AI is fairly complex as well
so I'm wondering what the concrete examples of pitfalls are
how to get list of player characters
or number of player characters
want to iterate this
loop
Getallactorsofclass
question is it ok to talk about materials here
im having a problem with blend modes
I mean.... graphics
no one responded
๐ญ
I been trying to apply a material function that needs the blend mode to be masked but with this part of the material disappears
@agile edge GetGameState->GetPlayerArray->Loop. From each PlayerState, Get the PawnPrivate variable, Cast that to Character.
I cant seem to get On Begin Cursor Over events to work. I have mouse over events on in my pc so I don't know what the problem is
@crimson saddle Requires the object in question to block the same channel the controller is using for MouseOverEvents. Can't remember if that defaults to Visibility or Camera.
my objects blocks all. I have the events set to visibility anyway
they should make blueprints text less verbose
Blueprints are intended largely for designers. Verbosity is semi required. And if that's your feeling, you'd hate my C++ code. ๐
er I mean the text that represents them
eg when you copy-paste a blueprint node into a text editor
Ah. It's just generated stuff. Most people never see it.
In theory, they could be concise and human readable => easier to share or even edit the text manually
I've seen your essays ๐
its weird because GetHitResultUnderCursorByChannel works
FunctionReference=(MemberParent=Class'"/Script/Engine.GameplayStatics"',MemberName="GetAllActorsOfClass")
NodePosX=-512
NodePosY=-32
NodeGuid=8770BDA844B998A2B8040A876C9A9924```
If you want to share blueprints, most people use.. Blueprintable? I think that's the site's name.
contains? might need to elaborate though
it just checks to see if it contains, i need check how many indexs have same item
I have no idea for that
is it actors or numbers you are checking?
only numbers
Is constructing object of class - in my case - widget text box cheaper/same or worse than making a widget containing the text boxes?
Aand, is it expensive to check a text against a large text array?
@tight pollenMake a function, input an array by reference as well as the thing to check against, output an integer. Loop the input array and == the other input. If true, increment a local integer and return it after the loop.
assume that the engine has made the most efficient option available to you @high ocean
Don't ever use ConstructObject on Widgets.
So should I wrap the text inside a widget and go like that?
ok, i will try
I don't know what you're trying to do
If you're creating a UUserWidget, you call CreateWidget. If you're creating normal widgets(Which you should not ever do in Blueprint), you create them with special Slate constructors which is C++ only and a rabbit hole.
So in short, yes, even if you have nothing but a Textblock, wrap it in a UserWidget class.
By "large" i mean a couple hundred members - text length itself is phrases & I'm only checking to see if it's contained.
got it, thanks! ๐
how frequent and what kind of operations are you doing?
100+ is a large amount for an array
Feels like chat box territory.
I open a "library" widget, it contains books which contain fragments. I take each book and check to see which phrases have been found. If found = display, if not = display "..."
I need the phrases to stay in order so I can't just "add" those found to empty arrays
Don't check the text. Save the Tags you've collected and check against the Tags.
why isn't each book its own entity?
GameplayTag comparison is insanely faster than string compares.
well if they're just checking if they're in the in the array, that's not a string comparison
the "verses" are the text fragments - didn't want to wrap them in a struct and check against bools, maps don't accept bools or text as keys so ...
Is anyone able to help? I simply need to be able to mark my actor as being hovered or not hovered.
@crimson saddleget hit result under mouse cursor (if you work with mouse), collision channel on actor set to block for the collision channel the trace uses. Otherwise, depends, the principle stays the same.
The localization person in me is cringing at this. ๐
pfff... if i get to that point it means the game did great and I have some money to get another generalist/engineer to get some load off lol
Verses doesn't even need to be a Text there. You can make them out of FNames or GameplayTags, and look up the text from another table.
I need to save them - how would I save objects?
???
The thing I'm not sure about is how to unmark an actor if I go that route. I can easily just hit an actor, cast to it, and tell it it's hovered. But when it stops being hovered I'm not sure what to do
same way you save anything else?
Actors have an 'ActorBeginCursorOver' event but that doesn't seem to work at all for whatever reason
that must work, check ur collisions - they aslo have an event for when cursor no longer is hovering over them
so, it's not like trying to save actors, since objects don't need to exist in the world - right?
savegame
then yes you can save objects
it'll be easier too
because structs are a pain to work with in BP
pfff... if i only knew that, I would've built some things differently instead of digging through endless, convoluted structs - y didn't i think of that? ๐ญ
so an object can have any type and number of variables - right? and I can use them as containers?
structs in BP were made for read only static data generally
you can write to them, but it's much more a pain than it should be
plus with objects you can have functions on them
That's the thing, it definitely isnt working for me. My collisions are set up correctly. Get hit result under cursor works but this event does not.
collision needs to be the same for both things
cursor over and off are overlaps if i remember correctly - not sure tho. they should work!
@high ocean I've found that for most gameplay systems, three structs are best in a lot of cases. First is a data struct that populate static data that the system can use for generation or whatever.
Your RowName, Rarity, Level, DropByRegion, DropRegionName, Experience and maybe Currency can go in one struct. This is all static data that your game systems can get with just the RowName.
Your actual game data struct just needs to have the RowName or a defining GameplayTag, and the collected Verses(As like a GameplayTag or FName, even Integer). This is what you can save and pass around. It's intensely smaller.
DisplayName, Potential textures, and such can go in another struct.
First and third struct can be made into a Data Asset or Datatable, and another Map or Datatable (Or multiple datatables put into a composite datatable) can be used for all verse Text lookup from every book.
another simple solution (not smart probably, but simple) is to make a probe collision that moves with ur mouse cursor, and check overlaps against that. It would however, move on tick which isn't particularly nice - lol tagged myself...
You get to separate static gameplay data from static cosmetic data this way, and your actual game data is much much smaller.
Well the whole struct goes into a data table. the only question is how to make the lookup display as many "..." widgets as it needs even though the array of "found" doesn't contain those?
so if using text and contain is expensive, i want to fix it now - but I can't wrap my head around how to make sure the missing ones are taken into account.
I could divide my struct into sub-structs, did that with the units since that one is quite large - aside from the fact that it's a pain to set members in members in members, it's fine with propper getter functions.
navmesh "P" is not working on landscape, green grids not showing. works everywhere else
the best design decision is to not have them. nobody wants to open a book just to be met with "..."
still not the right channel
fair enough, i can display nothing there, but i need to keep track of the order in which they are displayed. They can be found in different orders.
I mean I don't think there's a point in having a book that is empty
If it's empty, you don't have it at all ๐
it doesn't show, that's a different story. If you have 1 verse, you get the whole book with only 1 verse in it. Then u find the others to complete the story.
right but you were talking about having a library of books
where some of them had nothing in them
save yourself the trouble, and the player the effort and just don't have books with nothing in them?
If all of that is static data. I strongly recommend moving the Verse text to a separate table and changing the container for your verses to GameplayTagContainer or something.
thats what confuses me, if cursor over and off are overlaps what should I set up then?
Your widgets or whatever can look up the text from the tag, and checking length/comparing which you do/don't have is much faster.
so i remove the verses from the main struct, and make a custom gt table, with, for instance: bookname.versename & the verse text var?
overlap on both
Start by replacing the Array of Texts with a GameplayTagContainer. Just one, not an array of them.
Put a few Verse tags there like you mentioned. BookName.Verse or however you prefer to set them up.
oh oh... i think i get where this goes... each of them points to the text itself
Right. You can make a DataAsset with a Map of GameplayTags/FText or make a second Struct with nothing but FText in it and then make a Datatable out of that FText Struct.
Either way works. Would recommend the DataAsset personally, but it's just flavor there.
aham, never used data assets before, so might as well learn those too ๐
Create a new Blueprint and make one from here. This is it's class, you'll still need to make the Asset out of it.
That'll go in your content browser where you did it. Then right click again and make a DataAsset
Should end up with this after. Rename the maroon one to whatever you want. StaticBookDataAsset or something.
๐ฎ this is amazing!
and if i write script inside the data asset bp will it change values accordingly?
Don't put anything there. Open up the maroon one and you'll end up with this.
as in, not by the user
May be some form of way to do it in Editor BPs.
I was thinking cpp
They're just entry lines in an ini file though so nothing too hard in C++ at least.
so they cannot exist with the ini file?
how do they look as a parameter on an exposed BP node?
Immediately.
Best part is that you can also have separate sources. May be useful if you wanted generated tags.
So basically, this is the idea - right?
yeah basically the idea is to generate role tags and then have a combobox list of things to activate
I would settle for having the gameplay tags in an array rather than having them in an ini file
that's too cumbersome for my setup
Open your Widget that displays the text and make a reference to the DataAsset type you created.
Compile, then set the default to your maroon version.
You now have access to that map in the widget.
fair enough, but how do I check if they were found or not?
Where do you save your found data? You'll need to change that to save the verse tags into another container.
On my initial setup i just had a "found verses" array. I throw most of it in the GI
was checking directly against that
but instead of that, i'll have the gameplay tags now - I can have an array of the found ones in the GI the same way and check if they contain the ones from the data asset
Basically this.
If you want to check against all of the verses you've specified in your datatable.
yyep, ๐
well, each book will have its own verses, so each book widget will only check against their own really
Yeah. The VerseDatatableContainer would just be the container you pull from the data table struct for that book.
it's certainly more complicated than I've initially made it, but if it's considerably cheaper ๐คทโโ๏ธ
That tag check could probably run dozens of times for one text==text check.
I'm also being gentle on that, it's possibly more than that.. Curious now.
Also, if you ever decide to localize, you can either make stringtables, or just gather the text directly out of that one DataAsset and boom, done.
well how does it check really? letter for letter? cos then - wow
hence I mentioned the phrase length of maybe around 30 words or so... If it checks letter for letter then it's really bad.
especially if/when my game grows in lore n stuff
how else?
how would I know? I barely know anything lol ๐
ofc my engine crashed like crazy when changing structs
It basically takes each letter, gets an integer value from it, and adds that into a local integer, does the same for the second string, and then int1 - int2. If not zero, it doesn't match.
Jesus! Ok, i'll never compare text again - wtf
well, thanks for the help, would've broken my game w/o it lol ๐
Haha. It's fine for rare occasions. But when possible, best avoided. That's why I thought you were in chat territory. I've never had to compare text in any other place than a chat widget or for rare input checks when players try to name characters to stop name overlaps.
@maiden wadiAmazing stuff + I've learned quite some things tonight ๐ฅณ
One more question about these primary data assets then i'll piss off ๐
They have an event graph - does that mean I can put functionality there? do they have an initialization event or something?
Hi all I've been banging my head against the wall on this issue for the past hour.
I want to take the rotation of my blueprint, and pass that into a Niagara user variable so that I can ensure that the sprite renderer is always facing the same direction as the blueprint is.
But for some reason I can't convert the Relative Rotation to a Vector3
I've tried both using GetRotationXVector (which I think I'm using incorrectly because it always returns 0). And splitting the rotation into it's individual axes (which for some reason are vectors and not floats??)
Appreciate any insight into this matter
You can put any logic there you want. I do this in C++, but it's identical use case, you can do a lot of data organizing, or search functions. For instance if you had an array of stuff and wanted only some values returned, you could make a function here and call that on the DataAsset pointer like where you got the Map from. As far as an initializer, I don't believe so. They are extremely lightweight classes just literally designed to hold static data you can access from anywhere. I've never tried maybe storing other data on them and calling an init from like GameInstance or something. Could be possible though.
Great, thanks for all ur help! @maiden wadi ๐
@dusk storm Not sure if I'm understanding entirely, but normally you design the emitter to play in local space of the emitter and then you can just attach it normally. Then when the character turns, emitter turns with it and effects change accordingly.
Also, what you're doing will never gain a different result because you're getting that component's local space rotation. If that Plane is normally attached to the actor, then it'll rotate with the actor, and it's local rotation won't change. So GetRotationXVector will just give you a X1Y0,Z0 vector.
can someone help me spot the infinite loop? Cause I really don't see it. Happens when the button is pressed a second time, and a second element is added to the string>int map
I see, thank you I will look into this
This looks questionable.
oh
Hmm. Maybe not.
I dunno. I'd just start disconnecting Exec lines one by one and then replace them and remove another until it doesn't loop.
i mean, it doesn't cause "set experience" to be called again
Yeah, realized that a little slowly. ๐
I did it, but then I'm lacking functionality ๐
Where does it stop looping?
UE complains when "Add Experience Widget is called
which doesn't call anything
well not mine at least
unless...
does widget creation cause "on value changed" of its elements to be called when it's created? ๐ค
there's nothing in pre and construct
Possibly. I don't think I've ever used that event.
Looks like a slider event or something?
yeah
I know Combobox has an Enum you can switch on.
ohhhh no
caught it
it triggers value changed
๐คฆโโ๏ธ
how do i even avoid that
Use a gate and an event that opens it.
ouch since its before add child to vertical box, the loop it starts keep trying to add more widgets, cause it keeps seeing a different length of the container
what's a gate? ;-; i'm a blueprint noob
i speak C++ ๐
Boolean basically.
uhm flagging an active status after the value is set
I'm a little concerned that the scrollbar of a widget can cause it to be destroyed and recreated.
well it never will
i use that "set experience" both when adding a new experience, and when modifying and existing one
if it's modifying, the size of the widget container == the size of the string>int map in the character
so it will skip the clean and create part
(i'm making basically an ui-only application for android, a really battery intensive one, just cause ue4+android with UMG is way easier to setup than QT+Visual Studio+android xD)
It works now, thanks @maiden wadi @dawn gazelle
Has this the potential of returning a different index? Given that it's a pure function?
Another noob question here:
This "Set" node? Is it a custom user variable or is it an actual node that I just can't find the name of?
I've set up an ai controller to path to a specific location, attached it to a character in the world and I can see that it's trying to run. I have a navmesh set up and it's in it, but every time it tries to run it just returns "FAILED"
what might be a reason for that?
Nvm figured it out lol, it is indeed a user variable
well done ๐
@vestal plinthwhich ai node are you using to move it?
just to test it out, try using
and if this is working, then it's the AI node itself causing it - had problems myself with some of them, there are 3 if I remember correctly
ooh cheers
I was using the more complex one
yeah it's still not moving
is character the right type to use or should it be pawn?
something may be wrong with the target location I'm choosing after all
Character is fine. Maybe collision/nav?
do you call that node on tick, or less frequently?
not collision/nav unless the target location is invalid
jesus no! if you call it on tick, you keep on sending it the information every frame, it has no chance to move whatsoever.
you call it by event
on overlap, on beginplay etc
nah I'm not sending it on tick. was just checking
in theory, if the destination is somehow invalid, and the ai has acess to world origin 000, it will go there instead
to test it, just get a target actor, throw it into the world, make an exposed var in the character bp for it, sample the target actor from the world and have it go there.
what if the target location is a little bit above the ground?
that's exactly what I'm doing
you have an acceptance radius for the other node
i closed my engine - it's 4am here lol, but i think its called "Ai move to location or actor"
and also a bool for stop on overlap
are u using the default settings for navmesh + character? Maybe it's step height and it can't "step", it's too steep
i'd still make sure the capsule isn't inside the ground and it can actually move
that was the node I started with
I'll try it again
the navmesh is pretty flat
there's the navmesh and the character
try a smaller area? idk, hard to know with all the vars involved + sometimes (quite often really) navmesh bugs out. Make it dynamic at least until u finish testing. maybe it got messed-up
move the char a little in the air so it drops down on the ground when you play
I did
and it does
that's where it's meant to be going to
this runs every 3 seconds
move it on the floor and see if it works - is that a static mesh?
it's a skeletal mesh
it picks the location using a springarm from the camera so I know it's a valid location
no no, i mean, the target sits on something - a static mesh?
that's IN the AI controller
I'm guessing that code is inside the character
oh... but the controller can't move anywhere... You are telling the controller itself to move
you want the character to move, not the controller
that code should be in the character you want to be moving, not inside the controller.
what is the point of an ai controller if none of the AI code goes in it?
this is following the epic examples pretty closely as well
๐คทโโ๏ธ never used the ai move to on the controller itself, especially since I use the same controller for 19350 AIs and I don't want them to all move the same way in the same spot. That is the point of a controller. You want to move the actor's instance, and use the controller to do it, not move the controller itself...
that would just be bad design. you'd have to write new AI for each character
Not really, no...
I guess it's just the way epic's system works for the AI. I don't personally have any code inside my AI controller but it's necessary for the AI to move
each character would get an instance of the controller. in this case I have only one so it doesn't need the character to individualise the movement, but I'd still have the character fetch the target location and tell its AI controller to run the movement command
like, this is how it works
well, that is obviously not how it works ๐
it's fairly simple: I don't even think controllers of any kind have transform at all @odd ember do they?
they are actors
then they do
much in the same way a game mode is an actor
ok... well, it is what it is. I never found Epic's way of handling AI illogical or something...
that's not Epic's way to do it, it's just one way of doing it.
I tried a AIMoveTo and it returns "abort"
it must be a navigation problem
fair enough I guess, well, gl lol
it only works if pathfinding is disabled and it moves in a straight line. so, navigation issue. I wonder why
hello everyone i need to serialise data for save (player levels/stats, actors, player made structures, etc) and then load it onto dedicated server does anyone know how i could do it or point me to documentation on it?
need to make a save system similar to ARK or Rust
is there a way to set the default time snapping in curve editor from 10 fps to anything else. im always in 60 fps but i have to change it every time
How might i go about checking if a component forward vector is more towards one object than another?
Wondering if someone could help me with my instance mesh blueprint? I currently don't understand how I would make them along a curve, or basically rotate each building slightly after the next.
this is the output
trying to get it to curve like this
On each loop you could add say a 10 degree rotation (maybe set as a variable) then for the location you can use the RotateVector node which might do what you are looking for
Something like this perhaps?
i have a working navmesh on a landscape
however
on a non landscape
it works
but on a landscape
it doesnt move
and stays idle
thank you very interesting, this seems to rotate the whole spawner though like this
or did I miss something?
oh sorry you would need to increment the rotation each loop so possibly something like this... Im only guessing though
great thanks, what is this set node?
its that rotation variable
basically if you pull it out and set the right click on the little rotation node you can split it into different float variables
could do that instead
hmm okay sorry I'm pretty new at this, what exactly do I do with the rotation variable?
right click and what?
oh right sorry
if you look over to the side panel where you variables are
click on Rotation. hold down Alt on your keyboard and drag it out to your graph
or you can right click anywhere on the graph and search for Set Rotation
that is a get rotator, meaning it will get whatever values are currently set to the variable
that looks right
is there a way to more so be able to change each specific instance?
like I want the far buildings to be more rotated
basically I want to have building instances facing the road along the blue
people normally just use a spline based spawner for those types of layouts
of which you can find plenty of examples/tutorials for
(it just expands upon what you already made)
the spline based type will let you have the meshes rotate automatically to the spline/curve
thanks great to know, will look into this
Get normalized vector from component to target. Get component forward vector. Do a dot product. The output float will range from -1 (total dissimilarity) to +1 (total similarity). Then you can do comparisons
Anyone know a way to exit fullscreen PIE when debugging with breakpoints? basically the fullscreen PIE locks and I can't change view back to the blueprint graph that has the breakpoint. i can work around this but super annoying. (for example if keep the blueprint as a separate detached window I can switch view to it just fine but ideally i want to keep all blueprints as tabs in the editor view.)
basically something like this?
no, the input to the dot has to be normalized. It'd be like, target world location - component world location (or is it the other way around? lol)

