#blueprint
402296 messages Β· Page 800 of 403
@timber knoll you're looking particularly formal this year π
π it was a random thing from yesterday with friends
A very formal voice channel haha
What do you mean by this btw?
I initialized the size to 4 because I thought that the BP would get an error if they access the specific indices like 0,1,2,3 when setting the actors I placed.
With copy I mean you would still lose the previous size
But it wouldnβt do a resize operation is what Iβm thinking
You would go out of bounds yes, but the main issue is the C++ code gets run before your levelBP BeginPlay
I don't think there's an Actor array in BP
There is
where can I access that? XD
Just create an actor variable in your level blueprint and in the details pannel switch it to array
Wouldnβt it just be TArray<AActor*> exposed to blueprint
Been a while since I worked with UE C++ tho so π
this is what I'm doing before
Yeah but youβre setting the values on BeginPlay
thats right, succumb to the ease of bp π
Not in the parameter itself
That's probably true. Haven't gotten to a point where i'd need to check it. ^^
Nah Iβve been working on my exams π no time for UE
lol, i can relate, was writing papers in nov
I was talking more figuratively as the array will get resized from the copy, not the actual Resize() operation
Your C++ code on beginplay will only be aware of what BPs have in the parameters and components before playing the game
id be happy to help btw, instead of just spit out quips, but thats a long read to figure out whats wrong π
We are all in the same boat - unreal slackers is good for procrastination
π Iβm not procrastinating, I study game dev haha
Should have picked a games related topic for my thesis, oh well π
Check the variables you are feeding into the array, are they static meshes?
In my editor game, I have actors that cast to the player character. However, in the packaged game, the logs seem to say that the player is pending kill. ANyone know a workaround?
I think you should just check if the references are valid, before casting
I got you abaddon π
I like your little addition youve made there
Is there some sort of goto BP command just to clean the wires up a bit when you're jumping from one group of commands to another?
Always hire a qualified elechicken to do your wiring for you.
Youβve got me very confused haha
like an auto arrange?
Thanks for the quick response. The player was valid but It seems that it was just an error in how I put the code. Thanks for the quick reponse π
More like so you don't have to have a wire stretching across stuff like that.
But I suppose I could jump move the top block of code to the right.
Some of that cant be avoided - functions can help in certain cases - but for this, because theres an event, you can CreateEvent
Well blueprints is supposed to be from left to right
you already have all those things on top
Not so formal anymore it seems
Back to happy peepo!
In the end you have to find your own "style"
There are many ways of structuring your Code like using functions, macros, custom events, etc.
as conrad said, if you really want it to be above the beginplay: use an event to make it more readable
It's really weird, with blueprints I always work with functions and events
only do that in code when necessary π
Uhh.. blueprints execute left to right bcuz thats the exec flow....
Event begin play is the first thing to fire for this graph
Well "technically" you could go from right to left 
I will come knock on your door personally if you do that π
ΩΩ
Ψ§ ΩΩΨ¨ΨΊΩ Ψ£Ω ΩΩΩΩ 
There is a node called get velocity whats the name for the node set velocity
Hey,
I am trying to make a blueprint, who randomize only the numbers in this variables.
No Max Value and no Min Value only one of the number between the variables
Does anybody know, how can i do it?
you want to basically have one of the three?
make a random number being 1, 2 or 3
1 = A
2 = B
3 = C
an array would probably be easier to use (random index between 0 and size-1)
Hi Community!
Simple question: What might be the best approach to interact with objects in the world?
Using sphere trace by channel(or smth similar) or create for each interactable object its own collision to detect overlapping when the player hit it?
Really depends on some factors
is it 3rd/1st person, then you might want the player to look at objects
topdown/2D you could do sphere trace
own collision in case you want more flexible approach and different hitboxes depend on use case of the interactable
If you have many objects that can be next to each other overlapping can be annoying, especially when they are swappable like Weapon Pickups
What Eezeh said but even simpler. Use an array then use one of the randomFromArray nodes
I prefer to do manual pickups for things that are important like weapons for example
While potions are just automatically picked up with an overlap
But I guess it really depends on what you are doing
oh theres a node to do that with arrays π€ the more you know
New one I think ^^
would it be doable to not inherit the character controller that comes with ue4 - but make your own in blueprints?

Do you mean character movement component?
hmm i guess so...
Well although for my needs it'd actually be fine to still use the character movement component but just have my own skeleton mesh 
I dont think you easily get around atleast using their base cpp controller as a parent
because my problem is-
For some reason - when you add a character, the skeletal mesh is rotated by -90Β°
I think he's speaking Unity, where a character controller does what our CMC does.
Oh, my bad then ^^
and i'm trying to rotate spine bones based on where the camera looks, so i need the character rotation & the camera boom rotation
but if the character mesh rotation is -90Β° - it doesn't work well
CMC has nothing to do with the mesh being rotated.
well if you go and add a character actor, it gets inherited right
rotate it in your import settings
Show your mesh asset
Is it facing x axis?
then you can have it without rotation inside the blueprint
well it's just a-
problem is
if you want to have the Y axis the front one
you need to rotate it by -90Β°
You don't want to do that. X is forward in unreal.
but why is the arrow on +Y then? 
yea, by 270Β° right?
Hey, can someone help me? When I try to open some specific blueprint classes I get this error. Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000040 from UE4Editor_Kismet. Yesterday it all worked fine, nothing was changed since then...
Don't rely on the mannequin, it's been facing y since forever. No clue why it does tho, just a relic if the past
here's my issue:
i'm using these couple of nodes
to rotate the spine
so my characters head always looks in the direction of the camera
but if the mesh is perpetually rotated by -90Β°
i'm screwed

Your character or the ue4 mannequin?
mesh mannequin, sry
not the character, i'm using the mesh as a base, because the character has the whole "rotate based on movement" thing going on - which i could disable - but then the legs wouldn't rotate, which i want
this is stupid to explain, hang on
Why this prints only 0 everytime?
If you're not using a mesh which is aligned correctly on import then you're wasting your time. Do that first.
Or build your whole system assuming a charmesh facing Y, however you want to do it.
to show what i mean - basically this is what results due to the -90Β°
the idea is - the feet rotate like normal with WASD - and i'm using the standard character controller for those-
But i cancel the rotation out with the spine bones
that way the character always looks in the direction of the camera
which works - if only there wasn't those -90Β°
Turn on your capsule visualization so you can tell what's animating and what's just rotating with the actor and things will be more clear.
capsule visulalisation? 
colliders are hidden in game by default, you can change it in the details
oh you mean if i rotate the character with like a bunch of blendspace animations?
dw, that's not happening, i'm purposefully doing it this way to avoid blendspaces
think it's just to make sure the problem isn't with the capsule rotation
but i suppose the capsule is following your movement direction anyway
yeah
it's just the standard third person character
press D - capsule turns right. Press A - it turns left
that's why the feet rotate that way
Anyone with an idea how could I do it.
It depends on random value which number for X and Y I receive π§
pick two random, get their X and Y ?
Result.X = Get(rand()).X
Result.Y = Get(rand()).Y
oO
does he really want x/y from a different array element?
sounds like he just wants get random item from the array (if his UE version has that node), or random int in range 0 - last array index as input for the array get node
What am i doing wrong? I am just trying to get the location between two points and its all messed up.
It could be, it wasnt obvious to me with that attatched drawing xP
@feral ice plug both locations in a vector lerp node and set the alpha to 0.5
(LocA + LocB) / 2
you'd only have to add world pos if you were working in local space
there's also this
yea but only since 4.27(?)
there is also "random in range", but i love to shuffle. feels like casino-card-mixing, but i guess its based of the computing time so its not really random when you get a random number in ue4 :3
also shuffle is way more cpu "intense"
Hi everyone. I'm having a problem with this equipment system using child components. Whenever I run the function it tries to equip the base component despite the print string retrieving the child component name. Anyone got an idea what is going on?
OK this is my issue. I have a projectile BP that can be spawned by enemies or my player character. When they spawn it the send in a few variables. How do I prevent the enemy bullets from hitting the enemies, and my characters projectiles from hitting my character?
If you're using collision, I would just set a collision preset
correct collision setting, check for tag etc
But they spawn the same projectible blueprint
Would I need to make 1 for enemies and 1 for myself?
nah, but you have an instigator,
you could attatch a team tag to the bullet
or use the instigators tag
you could also have a function that you call right after creating
Cheers I'll try it out
to swap these things around at runtime whenever you want
<@&213101288538374145>
Thank you for the answers!
I think, that i am trying to do something other and i didn't explain it right.
Here a photo what i wanna do.
If the random number is 1 . I want to reset the coordinates to new location of X = 150, Y=-200, Z=27.
If the random number is 2 , then X=350, Y=-100, Z=27
...
How can i connect each of them to "New location" if is it possible.
The final goal is, that i want to reset the location of my target only at certain coordinates
then you should save the locations to the array
so you have an array of 3 vectors
then get the random index, and just pass the value from the array
which also solves connecting each since there will be just one pin π
recently I started exploring collab viewer template. i am trying to run build for windows 64.i am able to connect with other users on same LAN network but could not connect with users on internet. KINDLY GUIDE
I've got a blueprint derived from UStaticMeshComponent which I'm creating in my actor, but when I call DestroyComponent on it in the actor blueprint, the component doesn't actually get destroyed. Any idea what might be causing this?
ah I see you already asked there
hard to tell without more context
where do you destroy it and how does the actor look like?
I think I solved it
I just moved the destroy call into the component blueprint itself and now it works
Am I missing something, or can actors components not have timelines in them? Kinda rules out a lot of possibilities for components π€
Whoops wrong channel
@dusky harbor draw out from one of your vectors and use "select", maybe that will help
Did some more testing with the equipment system and I noticed in the world outliner that the weapon appears to attach to the character, yet it still stays put on the ground.
My janky one for example
I have a scene component on each socket, and switch them between the components... seems to work
anyone able to give me and indication of how I would make the character look towards the mouse cursor as well as shoot towards the cursors location? trying to do it for a 2.5d side scroller but I can't find anything online to help
get hit location under cursor, break vector, use depth of character
They cant directly but you can pass in a timeline if that helps
components can't have components
timeline is a component
Ah cheers, might have to resort to that eventually π
so I have this code in now to change the rotation but the mouse cursor isn't actually moving for some reason
i wanted to ask something about blueprints basically i wanna make a mario kart styled item box and wanted to ask how i could make one as all resources i can find are well closed source :(
What part of the pickup are you struggling with?
basically with everything tbh >w< like the item box dissapears but its the item giving part where i struggle with basically i wanna make my item appear behind the player
That would be attaching a component to your player character, to a specific socket maybe
Basically the same deal as equipping a sword isn't it?
and also the item giving part where its like doesnt give ebverytime a different items tho i just got 3 implemented rn into my game
uuuh i guess >w< sry i barely work with unreal but our college basically wants us to create a mario kart styled game with items and we have to finish it in 3 weeks
its just the item part where im rn struggling with if i could fix that than a huge rock would be lifted :P
The above still applies, it's not particularly different conceptually to equipping a sword for example is it?
BP sets are allegedly immutable, but adding/ deleting nodes in them works still... UE docs π€
Yeah I just checked the source out of curiosity, they most definitely are not immutable lol
I'm guessing by that they mean the items in a set can't be changed, so you could remove something, edit it, and put it back, but you couldn't get a reference, do something to it and expect it fixed the original item
Its very poorly worded don't get me wrong, but that's my hunch anyways
btw uh may i ask would yall say to use a item database just for 3 items? >.>
Scalability
@smoky marsh I don't think that would work because it would suggest that for example if you were to store actors in it, it would end up duplicating them every time you tried to access them
I think it would just make a copy every time you tried to change it,but not if you just needed a reference to it. Say you have an array that takes up x amount of bytes, for some reason you've decided to store it in a set, now that array can only ever have that size
It doesn't work like that in C++ so I'm not sure why they would change it to work like that in BP's π€
The note about it currently being immutable in BP might be why
I'm guessing the set is actually just a set of pointers and not actually the container
So they set it like this for idk, safety I guess, bp limitations, someone else might have a better clue
Well I'm looking at the C++ implementation of it and it doesn't really do anything like that so it looks like just a goof in the docs tbh :D
Lemme give it a one over as well, I'm curious now
It's in Containers/Set and BlueprintSetLibrary
Looks like pointers to these eyes
Yeah, and the set library just takes refs as parameters with void return which does suggest it's definitely mutating the input
I'm not sure how to properly describe my issue but pretty much I've now made it that the mouse cursor is visible at all times as it is currently a crosshair and when the player left clicks it shoots towards the cursor/crosshair. But for some reason when I left click the cursor will disappear and it won't shoot, it will only shoot if I double click.
its got something to do with unreal when you hold left click it just hides the cursor?
i'm copying this blueprint from unreal's official fluid surface tutorial, and my project doesn't like the "static mesh component" nodes. i can't make them from within my own editor, and copy-pasting them in from the website throws errors. following the tutorial, i have a "static mesh" type variable but no "static mesh component" type. is there a way i can work around this?
you get them by adding a static mesh component to your blueprint
which is not done by adding a variable, but above that on the blueprint hierarchy is an add button, search for static mesh component
if you now hold ctrl while selecting the component and drag it to the blueprint graph, it would give you the variable reference
thank you! they really ought to be more clear on stuff like this in official tutorials
may i ask uh so basically my object needs the e key to get picked up but i would like if it it immidially could get collected without having to press e
Give the object a collider and pick it up on overlap with player
uuuh how do i add an collider? >.>
Is that something Google may have an answer for maybe?
The UE Learning Centre definitely covers it in the intro to BP as well, IIRC, which should be required completion before joining here π
oooh oki
ye i mostly work with godot or SFML but we had to use Unreal for the School Project without any prior knowledge
Hey whats the go to solution for handling camera bobbing and movement? I find timelines to be a bit unwieldly and the camera shake component seems a bit too random for an attack camera animation for example.
tho im fucking stupid i finnaly found out how to add an collider
gotta start from somewhere
doesn't mean you're stupid if you don't know everything lol
Stupid is a strong word, but we're all clueless when it comes to things we are inexperienced in.
spring arm probe collision not working when I change the target arm length of spring. Anyone knows please help
I've got a gun that has standard vars, like magazine size, rate of fire, damage. Stuff you would expect. I add these to the gun in the construction script. If I have a modifier that lives on the player (+1 to magazine size). Can I grab that var from the player and add it to the magazine size in the construction script? Or should I do that in event begin play for the gun? I'm not sure the order things execute.
right so I have this code for a full auto rifle, the sequence is connected to left mouse button and when its first pressed it works fine, but after the first time doing it the code doesn't work unless I double click the left mouse button. Anyone got any idea why this is?
are blueprints bad?
any Games Created 100% Fully with Blueprints?
||
don't misunderstand it π€ ||
Bad no, 100% bp's yes, afaik for example Epic's Robo Recall is BP's only
But more complex games will usually benefit from using C++ alongside BP's as it can offer advantages, and not all engine features are available in BP's
I think Mortal Shell is close to BP only, as they ran into issues with nativization for example. It's a soulslike
I'm sure there's lots more examples too
A lot of game engines offer something like a "scripting language" and BP is UE4's version of that. It's meant to be the primary avenue for creating game logic and prototyping stuff as it's a lot faster to work with compared to continually recompiling C++
For complex projects that need C++, Epic still intends you to use BP and C++ together
Something like this?
https://www.tomlooman.com/unreal-engine-render-character-wounds/
some says visual scripting is bad! what do u tell about it?
Most of those are coming from typed programming elitism.
In reality it's a balancing act and more importantly getting shit done.
i see many YouTubers teach to use blueprint than c++
because blueprints are easier
and it allows people to shortcut certain rules programming has setup
so you can make rapid prototyping at the cost of well established architecture
Yeah the article seems to suggest sphere masks, which is a material graph node iirc. Whatever technique you use depends on what you need the effect to look like (is it like a wound or does the whole body part glow?) and how long it needs to persist (does it need to track with character animation?)
Maybe ask #graphics or #visual-fx for ideas. I've never dealt with exactly this thing before.
is there a node that lets me point an object to this lil cube that i have (it's a child of my camera object) ? 
like always just point to it
Hi everybody.. i have a problem regarding my Blueprint . It is a water volume so i added a plain with water texture and a box collision below... i tagged the box collision to water, than for my camera controllers on begin overlap event i add the post process if it collide with something with the water tag .. in the editor it works perfectly but as soon i built it the event doesn't run anymore .. i added print string nodes to find out and it prints in editor but not in the build. Ps : i builded as development so i can still see the prints in the build.. i wonder if anybody had the same issue or have some idea how could i fix it.
Find look at rotation
Or i think you can lock the camera to it?
look at rotation 
well- what i want to do
is point the head of my character to that little cube
problem is, the head of my character (the bone) runs on relative rotation
and my character rotates using WASD and rotates based on camera rotation
so i need some way to either basically make the head bone rotation world rotation
Or just skip all of it and use a lookat
Look at gets the starting location and end location and calculates the rotation needed to look at it
It can be done multiple ways, even with an aim offset or you indeed just rotate the head bone
hmm that does sound exactly like what i'm looking for 
it takes a vector tho
and all i got is a rotation
can i just convert it? 
WorldLocation of your Character and WorldLocation of the Cube i think then use the Rotator to SetRotation or such
Gotta see what fits the Start the best in this case
ooh i need a location
ok that makes more sense
is that node expensive? I'd need to run it every tick 
Should be fine
Custom Loop that updates just every 0.1 seconds or so? Might be less expensive then running on tick
god damnit, never mind it still doesn't work 
because the bone is on a relative rotation
for look at to work it, forward = x axis
you could just save the relative rotation at start and use that to decide the actual rotation after look at
You setting the rotation in the AnimBP?
yeah
Pretty sure there's an option to use World Space
custom loop?
π€
If you click on the Node and dig into the details
i'm basically modifying the bone rotation of a bunch of spine bones
hmmm ok i felt stupid, and put it to world space, but it didn't change anything 
Custom Tick would be a more appropriate naming I guess
Basically just a timer
hey i have an anim montage and i want to it to loop it a certain number of times, is it possible?
Actually Unreal :p
how many characters will need this behavior?
only my player
then performance wise tick isn't an issue
it's so when i'm in combat mode, my character always looks towards where my third person camera is looking
well-
it doesn't seem to work anywho so...
plus all your nodes have lightning bolts, which means they run on the animation thread instead of the game thread
that takes in two floats
for random playing of the loop each play in the timer.. ks that Time, Initial Start Delay, or Initial Start Delay Variance and would it calc a new range each time the timer fires or no?
uh my bad, dot product is what you're looking for
Blueprint Cons: (Avoiding people's personal preference issues here like not liking node based design)
β’Blueprints are slower to execute the same logic that C++ would and this causes problems with heavier code. This is immensely true for any sort of math equations as you have to copy the values around a lot instead of being able to reuse them and each node has to recalculate the things it's using every time something pulls a value from it. Sorting is another major flaw here. You have to write slow executing, complex blueprint functions to redo what is a single line of C++ code using a predicate to sort an array.
β’Blueprints are designed on top of a complex framework of C++, this means that they only have access to what that C++ allows them to. This makes changing game framework extremely difficult without simply redoing the entire system from start. There are thousands of virtual functions in C++ that are not blueprint exposed that are extremely helpful.
β’Blueprint structs are extremely unstable. One bad compile change can corrupt blueprints using those structs. Possibly a fault with the generation code. This has been less of an issue in recent releases, but it still happens. It makes altering structs in BP very dangerous. In C++, this is not an issue as long as you do not rename variables.
β’Blueprints are not text based. They are binary files and this makes diffing them in source control mostly impossible. This causes strong problems with people working on the same code base. When most logic is in C++ this is less of an issue because most of the changes are there and there may be minor BP overlap that can be easily corrected with a second source control commit.
Blueprint Pros:
β’Blueprints are extremely fast to iterate in. You can change logical order and test it much faster than in C++. This is due to BP compiling much faster. Even livecoding can't really match this. This makes Blueprints extremely nice to prototype in. You can get a good idea of what you want your logic flow to be in a very efficient manner and then translate that to C++ and optimize it there if necessary.
β’Blueprints require less to learn. An example of this. Lets do the steps of starting a new project and creating an actor that prints on beginplay. You download the engine, you start a new project, you are in the content browser. To create a new blueprint actor, you simply right click on the content browser, drag off of the beginplay and type PrintString, add the node and you're done. In C++, you have to first close the editor, download an IDE like Visual Studio. Create a new C++ .h and .cpp file. In those files you have to set up your includes, write your UCLASS(Which means knowing class naming conventions, what specifiers you'll use, knowing to add GeneratedBody macro, a default constructor, etc), add your virtual void BeginPlay() override function, implement that in the cpp file, then you can write your print code after adding the kismet library include. Now you can compile and restart the UE4 editor and use your actor.
β’The next is the biggest pro to me. But it is also a severe problem with allowing designers access to assets and code without them understanding how pointers work. That is that Blueprints have access to everything easily. Need an image in a widget or a static mesh in an actor? Just search for it by name. you don't need to know a source path to the asset or anything. This is fantasic because it allows very easy access to your whole project without having to hard code asset locations like you would in C++.
Yeah thats what its called thank you
forgot the name
@feral ice

wall of text
yes exactly thanks @maiden wadi
#blueprintessays
lol can i repost my question then "essay"
try it
hmm
If I remember correctly it checks the input everytime
Well atleast the Time Input, im pretty certain on that one
wrong mention lol
lol
Sorry about that one lol
@coarse forgeThat only calculates when that node is ran.
in this case.. once because begin play
Looping timers will remain the same. If you need a changing timer, you have to have a timer that doesn't loop and will call the set timer each time.
hmm
calling timers to set timers
that's next level
calling timers to set timers on tick
now you're thinking
trying to see if i can do this without timers hahah
and not sure I want that much on tick
these are playing sounds
use an event track with a timeline perhaps?
Hi not sure if this is the place but if you had a "MasterItem Blueprint" which then made children say for example a Sword (Melee weapon), Grenade (Ranged Weapon) and a Healing Potion (Obv) would you
These children would have various functions Sword - Attack , Grenade - Throw, and HealingPotion - Heal X person who collects it.
Would you have the functions of Attack on the Sword or the Player who collected the sword? same with the Grenade and healing potion ?
Hope this makes sense, I will try to upload an example blueprint. π
So it would be something like "Player X collects the sword", "Then player X hits the mouse button and then get cast to sword -> attack ?
you can probably abstract it to be a Use() function
in laymans terms xD
you don't need a cast
you just call the function
the sword Use() could be an attack
but the healing potion Use() could be healing
the grenade Use() would be a throw
etc.
Ahh yes i never thought about that.
as i had a MasterItem which had a Blueprint interface which had functions of Throw(Grenade), and Attack (Melee Weapons) and UseItem(HealingPotions) so they would all inherit these functions from the master ?
so just make them inside the masteritem blueprint?
Anyone know how I would go about getting more information about a node in blueprint? For example how can I know what As VRPawn is doing?
in your master/base blueprint, create a Use or UseItem function and leave it blank (or returning a bool or something)
have a Use inside the master and then every child you create you make a use function for each individual item ?
you can then make inheritance hierarchies that increasingly add functionality
Ahh thank you that makes sense! π
so the base weapon blueprint would start using UseItem as an attack
but still keep it generic
@rain mossThat is a variable. It's type is a pointer to an object. Pretty sure you just have to spend time in the engine and learn the environment.
Yeah for sure I am very new thank you for you help! @maiden wadi
Feel free to ask questions here as well.
i thought i would try to use an interface but maybe thats overcomplicating things when it doesnt need to be. I,ve not really used interfaces yet so not too sure how they differentiate to functions.
interfaces are if you have multiple hierarchies that need to share functionality
so maybe you want Use() to be a thing for NPCs too
NPCs obviously aren't items
but with an interface you could have the same functionality
is this on the right track?
so Use() for NPCs maybe calls their TalkTo() functionality
whereas on items it calls UseItem()
Sorry im really new to interfaces how would it differentiate like if the NPC walked into the sword weapon and then you had a behaviour if npc close enough to player Use() weapon?
that's got nothing to do with interfaces, that just a function of what happens when you swing the sword
I,ve seen videos and tutorials on them but its a lot of "do this and do that" oh look you have a workiung interface but doesnt quite tell you why
you could use overlap events to set a variable
Most people are trying to use timers wrong.. ha hahaha...ha..
I think i need to do a lot more reading on when and how to use interfaces xD but im only about 7mths into UE
they are very abstract, which is why they don't allow for functionality implementation
forget about interfaces
really
@crude dew Good example of interface versus inheritance. You have a button press that line traces to interact with something.
You want to open a trade menu when used on other players, you want to open an interaction menu when using it on ally AI, you want to cause ally AI to attack. These can all inherit from your pawn class and be the same function override in each child class or instance difference.
But then you want to line trace and pick up an object. Now you need an interface. But instead of interfacing to every single class, still consider the hierarchies. You can make a single class of AInteractableActor that has the interface and then other classes of that which can handle that interaction through inheritance.
Like say, ADoor, and then APickupable. These need to do different things but can inherit from AInteractableActor.
The only classes in this scenario that use the actual interface is the PawnBase, and AInteractableActor. But now you can have wildly different use cases for everything without repetition.
interfaces are generally not accomplishing something that can't be done better by using event dispatchers (which people seem completely oblivious to), or just plain inheritance
@maiden wadi Thank you for that explanation!
only really in the instance of multiple hierarchies do they do what they are made for
In a perfect code base, interfaces are useless. You'd just put the virtual function higher in the tree. But when you can't change basic architecture, it's your only decent option.
Maybe this language hahah
0 tech debt
The unicorn.
tech debt is job security
Only if you work for someone who doesn't know better.
They all work for me.. soo... π
There's always something else to be made.
If product can't get me feature stories.. we do tech debt
my engineers always have something to work on
different work though.. not game related
I don't think my personality would let me do that. Too much of a stickler for doing it the correct way. Mostly because I'm lazy. Correct means me not fixing it later.
Wut?
well i have an idea to ditch the timer
and just play my function with a delay during tick with a am i playing flag
but.. delay node isn't available in a function
no exist
sorry for asking again but is it possible to loop an animation a certain number of times?
because its not an audio issue
anything is possible
i'm doing it in a blueprint
i mean not an anim bp
this one is in hud...
well maybe, just maybe #animation would still be the place to go
i'll see thanks
@coarse forge Loopable timer with variable differences.
i don't think i'm gonna get any response
I need help, i have a simple blueprint that allows me aim around the mesh when i press a button and when not press it will return to its original point, the problem is that if the mesh strafe and rolls when aiming the spring arm controlling the camera returns tilted is there a node that resets its rotatiion
Thanks man
rule #2 of this server
my bad
Thx, so in this case my actual function i want executed goes in the HandleTimerFinished event correct? I've only ever used the timer by function name
With what I posted, you'd run the stuff in TimerFinishedLogic. It calls that before checking if the timer should rerun.
idk how to get help but my stamina doesnt increase or decrease
thx
I've been using UE4 for a few months, but somehow I still can't figure out casting at all. I have a simple blueprint in the world that spawns enemies. I want the gamemode to cast to it (for the sake of being able to change difficulty) but I don't know what to put in the wildcard. Every single suggestion I've found for this either looks convoluted and not something I understand, or is in reference to a type of BP that's got an obvious inheritance.
This is just a regular actor blueprint that sits in the level, and I have no idea what it inherits from.
@dreamy musk #blueprint message
Casting basically helps you with nothing, it's a way to check if something is of a type and then to access all it's data and simultaneously bind it if it's a hard reference, what it won't help you is with actually getting the reference
Thanks this worked
much easier
Sweet
Set it up like this
Exactly
Unless you wanna do some global search its probably easier to let the spawner wuery the gamemode insteqd, since its globally accessible and all that
Please review this and help if someone knows about that.
But I need the MaxEnemies variable to be globally accessible, since the spawners run off their own MaxEnemies variable
it's set to 4, but that means each one spawns 4, I want 4 to be the max ingame, period
Which is why you could pit it in gamemode, if you find that a suitable spot to have it
Theres a global static get gamemode node
There is no global static get "myCustomActor" node
There is if you make it. π
True^^
there is, on actors
GetGameMode
All can be, if made so
Exactly
well gamemode is an actor
so it requires world
and anything that queries it would have to have an excuse for finding a world
hence why objects don't have it
you could also make an enemies subsystem to hold and manage all that logic
Which would work perfectly in this case
I think I got more async shenanigans breaking certain variables.
But may be way out of scope :p
subsystems are the best
Cant wait to start with async. Need to up my trace performance
async trace?
Ye
π
It could hold your max enemies, and your spawning of enemies, and when one dies, etc you want to spawn another one.. accessable from everywhere
Purely for path tracing
I'm using a macro to load character data and then spawn them in. Needs an input int for setting array stuff. Currently the macros are being called like this
Did I read async trace?
However they all seem to use the last int value passed.
I'm interested
Can I not have multiple instances I guess of the same macro running at once?
What macro? Those are functions.
Oh yeah; I had to make an event that calls the macro because the macro exists in the parent class.
Those are inside of the macro?
That's in the parent class.
Gamemode^
instead of the ball?
Gamemode
What does your macro look like
@astral epoch And I assume you have some form of latent nodes in the macro?
Yes. Async Load Class Asset.
It reads that input soft reference.
Hence spawning different characters with one thing.
Give me a sec to clean up the print strings.
Load, cast, spawn
Takes the newly spawned character and sets them as the pointer for an array that holds all characters for this squad
That index for the Set Array Elem is the int being passed in.
Which should be 0, 1, 2, 3, etc.
Looks like you're calling em before finishing the load
And with a delay after each it works fine. Without, they all end up with the final int value.
Yeah, you're calling the macro multiple times. By the time the async runs, the macro has been ran multiple times so when the async callback runs your variable is set to the last thing.
I figured that's the case. But wouldn't macros have multiple instances firing anyways?
Spring arm collision not working if I change arm length at runtime please help on this
Right but your int is being set instantly to the last one
No, a macro is not instanced every time it's ran, it's "instanced" when it's placed in the graph.
Cleanliness. It looked a lot worse before and was taking up a lot of space in the graph.
Just chuck it into a function
Can't do function. Has latent operations.
Just chuck it into a separate graph
Unless we're talking custom events and not actual programming functions?
Right, should've been more clear on that
Logically you need to separate your call and the action.
(legit forgot you can make multiple graphs)
Good heavens your poor blueprints
Just a bit
Not the worst I've worked with though. Had to pick up the work of someone who put everything on the on tick.
I mean everything.
Ah, a stress test we call those
No wonder the game ran terribly on my phone.
But yeah, move macro to a graph of its own and calling a custom event instead of a macro should work here?
Not really.
Also seems kinda weird that macros aren't inherited by children.
Probably not anyways, just like wait for the async to do its asyncness
I doubt it's slow enough to worry about it
I can try that but I don't think it helped?
Since it was calling through the event anyways, it was firing that then letting it run while it ran onto the next character.
Async is always at least a frame behind in most cases. If you want to do it that way, change it to blocking. Otherwise you need to create a system where your calls input data, and the system spawns them from that data and removes it.
Delays helped but I don't really want delays everywhere just to fix order of operations.
Have it fire an event when it's finished letting you queue up your next action
With idk a timer trying to fire off the call while waiting
This is just an off the top of my head thing from looking at your setup
I fixed some of this in my hud's by overloading a custom intiialized event that fires after begin play to ensure all my widgets were in the game before adding them
Dunno if I'd necessarily do it this way
Couldn't you just increase your current index every time you run the function, that way you wouldn't need to set it to 1 then 2 then
..
i haven't done any multi player, but maybe spawn them all, send events to a subsystem that holds that info on is the squad full, then fire event on full to start game
To be fair the way I had it before worked... it just looked messy.
But basically instead of using the macro I just had its code copy-pasted for each character spawning.
Which got the arrays correct.
@astral epoch What is ArrayPos? Is that the index that you need to add the spawned actor into an array?
Never be afraid of your shit looking bad, this is just hiding it instead of showing it
Yes Authaer, exactly.
Better to clean it than put it under a rug
Sec
So I have two blueprints that are copies of each other, though they aren't children. They both have tick events in them, but when I save and compile one, the other stops firing. Whichever one I compile works but the other just doesn't. Does anybody know what the issue might be?
copies how?
I copied and pasted one blueprint to make the other, then renamed it
Did you copy the Event Tick part too?
yes
Could be wrong but I found copying the event things to be janky at best.
So what do you recommend?
Its copied into another blueprint right?
yes
Then put in a new event tick. Right now what its doing is creating a custom event that has nothing calling it.
And hook it up to the event tick.
cause I don't know what I'm doing and this seemed like the easiest way
yeah but that aside there's no point to having 2 blueprints with the exact same functionality, unless they are in a hierarchy
and in that case you don't need to copy anything
I swear blueprints will cause the fall of our civilization at some point
I did that for both of them but it still only works for one at a time
I'm just gonna see if I can figure out parent stuff and get that to work
delete the code from one of them
parent the non code one to the parent
spawn the non parent
done
yes but I want the non parent one to output a different value than the parent
so... make that a variable in the parent and set it to a variable, then change that variable in the inherited class to something else?
if you're ever finding yourself repeating code
you're doing something wrong
All of that just flew over my head
I understood nothing
I would go do something like learn.unrealengine.com or similar
until you get the basics
if you continue as you are you'll only dig yourself into a hole
sorry i know this is probably a stupid question but i keep clicking components>add component and adding a static mesh, and nothing appears in my viewport?!
because there is no mesh assigned to it π
@astral epoch This should help. This is a simple spawning system that allows you to ask the system to spawn a soft object class and place it into the spawner's array of spawned actors at an index. Added some prints for logical order explanation.
The whole of beginplay is unnecessary and just for show.
does anybody know what this error means?
is there a way to always make a sprite appear in front of everything else?
Did you drop the actor in the level
yes
looks like you are using a plugin
i'm not using a plugin, i've been following this water tutorial https://docs.unrealengine.com/4.27/en-US/RenderingAndGraphics/RenderTargets/BlueprintRenderTargets/HowTo/FluidSurface/
at least, i don't think i'm using a plugin
yeah where is the thing that holds that funciton?
can you show the BP you made?
access none is a null pointer
which means it can't find the thing you are calling
i've fixed that error (i just didn't specify a render target at one point)
now i'm not getting any errors but my entire effect just isn't rendering?
it's completely invisible
my url?
Sorry, something came up yesterday - so when you specify Casting here, I have access to the FadeIn variable, what am I casting to, node-specific? "Cast to Widget"? "Cast to WidgetComponent"?
i think i meant handle or whatever, your discord name
that's brilliant
what about my material/s do you think i should be checking?
i copied them all from the tutorial
um.. well its been a year, but with water there is tranlucency
i would ask in #graphics
they'd be able to help with that much better than i
alright i'll ask there, cheers
you are casting the widget component in the bp to the widget class where you made its variables - then the return of that cast is stored as a variable in the former bp
not CastToWidget
Cast to whatever that widget class was
i cant recall, it was so long ago π
Hahaha, ancient history
is there a way to reset the spring arm to its original position and rotation?
i think so yes... hang on
should be something that calls it to go back to the behind view of the character
Hmm, might be an additional step, but we're on the right track: "TeleportMenu does not inherit from Widget Component"
whats a good way to disable player collision so you could do a roll or a dash that passes through an opposing actor/enemy? been trying a number of things to no avail. just want to allow them to pass through any other player when rolling/dashing, then enable it when finished
you're not disabling collision, you're changing collision flags π
i am? or i want to?
thats what works for me so i dunno, did you change the FadeWidget variable type to be that of the cast?
to allow the player to still collide with Static but not with other Pawns, yes?
@brazen merlin Thank you
yea basically. its just a side by side fighting scenario. and i want the roll to pass through the opponent and other actors. like fireballs and all that sorta thing
so really its like "dont collide with anything except mesh"
well
not mesh
then yes, but again, you'll need to pay attention to how things use collision channels
basically anything that isnt an actor i suppose
WorldStatic seems like the best minimum so they dont fall through the floor
think in collision channels is what im saying
you've got trace and object responses
i saw mention of that in my googling just need to figure out how to set it up
so decide which to turn off and then back on
ill go watch a vid on collision channels
or even better, make yourself two collision response presets and then simply set the profile by name
ty
readin up on it now thanks
interesting, so i could set up a preset or whatever that says... overlap, so i could still get overlap events, but still allow you to pass through
like if you passed through at a certain time. perfect dodge so to speak
ill watch some vids on it as well. appreciate it
im going to throw you a curve ball
i only allow damage and other events to register if my player has a certain tag π
but what is the tag setting?
the point is that i check to see if that tag exists
still, you do need collision control, just wanted to mention it is all π
i thought about setting it in an notify state event so i could just drag the window out, make that section pass through, and also generate special overlap events while active
you could still do that through ANS or whatever side, so its frame-specific
you'd still need to called SetCollisionProfile and set them from one then back
yea thats pretty cool. ok ill give it a try
Get widget is missing
i didnt need to do that. It is a widget object already and GetWidget returns the same
i believe SetMembers is what you want
Actually @gentle urchin may be right - having added a get user widget object to the mix, I can see specific components now:
FadeIn is a widget component according to the warning
well i mean, this is working fine for me....
that my thing yeah
As a comparison, FadeIn is a WidgetComponent
and is therefore WidgetComp
Yeah but its a userwidget ref, correct?
Widgetcomp is afaik != userwidget...
Cheers this was correct
to be clear, casting my WidgetComp to my WidgetClass to then get my vars
w/e if that works then it works
no sense arguing π
Sorry, it wasnt clear what type yours was :p
I prefer making the widgets, saving them, and setting the component to my widget
But thats me
Dunno how you do it π
honestly just referring to this one situation where i am using a widget component and this was setup awhile ago so i dunno this sort of thing that well
if you can tell, its for a health bar to appear above the specific enemy
I see^^
Im used to atleast having to get the widget object from the component before casting ^^
In my little head it just works as a container for a widget
all of my other widget stuff is always by create and then storing
Phew, sense restored! Jk
conrad i must be missing something. as a basic test i just tried to set collision response to channel to pawn/ignore. still collides hmm. also tried world dynamic
collision between pawn and what?
the other pawn / character
did you set it to ignore for both pawns?
so on action, the collision response of my char ref > mesh > set collision response is channel pawn / ignore
One message removed from a suspended account.
I don't know what you're trying to do
basically character 1 does a roll/dash. idea is that its fully invuln and can pass through/cross to other side of the other player
character or player controller
One message removed from a suspended account.
capsule probably needs to be set to ignore pawn
let me try
what are you trying to do?
keep in mind that collision is two way: both things need to be set to ignore
One message removed from a suspended account.
hrm interesting. according to vid i watched they said it was priority order, so if one had ignore, it prioritized the others block
One message removed from a suspended account.
if you put that event in the coin, you would pick it up any time by pressing E. find a way of making it available to the player. that way you can use your input action on character to make it work
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.
not sure what you mean then
hm having trouble even turning off the collision volume. i have a ref to my char from other bp.
One message removed from a suspended account.
that doesn't sound right
One message removed from a suspended account.
cool. what do you need input action for?
One message removed from a suspended account.
and that can't be on character because?
One message removed from a suspended account.
when you pickup a coin, set a variable on your player character
One message removed from a suspended account.
that needs to be set in the player character BP
well you need them to communicate
ok got it. got my ref, got capsule coppnent. set collision response to channel pawn > ignore. now i can pass through
set to overlap (which is what i wanted) and it works. i was prob using wrong nodes. guess i didnt need custom chan at all
Yeah if you really want the variable to be in the coins, the player character BP needs to have a method of querying the coins BP and checking
appreciate the help CE
either directly expose the variable, or expose a boolean "hasCoins" function that returns true if there's any remaining. Something like that
that still means the coin will be a variable on the player
i suppose i can turn this on/off with an anim state now. ill try
Well no, the player just needs to be able to get a reference to it
One message removed from a suspended account.
animNotifies are you friend
indeed lol
i had some issues with them earlier
BP communication is hard for most newbies to grasp is why
all code is hard to grasp
Worth saying that like 90% of programming is basically building pipes to get a value from Point A to Point B
One message removed from a suspended account.
it's not difficult at all
computers are dumb, but they are fast dumb
One message removed from a suspended account.
When it comes to BP I'm not sure how it could be simpler. I guess the requirement of casting in some cases trips people up?
you have to tell them everything you want to do, exactly how you want to do it
That's like saying, why have multiple levels instead of just loading the entire game all at once
One message removed from a suspended account.
One message removed from a suspended account.
because it sets you up for failure. once you understand system architecture you also understand why global variables are bad
anyway take it or leave it
if you want "global variables" store them in game instance then get a reference to game instance from the specific class
One message removed from a suspended account.
I gave you that tutorial
If all variables were global, can you imagine the global variable space in a game like RDR2? It would be a nightmare. Literally millions of them, you'd never be able to find anything and the computer would struggle to hold it all in memory
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
do you want to learn or do you want to complain?
One message removed from a suspended account.
I suggest finding someone who cares then
One message removed from a suspended account.
One message removed from a suspended account.
You wouldn't use global variables in JS either, it's object oriented just like BPs are
only half way true xD
One message removed from a suspended account.
Ok JS is a trash fire but you see my point still π
javascript allows for weird BS, not a language to measure against for any good principles really
A variable in a global scope is still associated with a specific class or "file" at least in the JS world
You can have global-scope variables in BPs, they just have to be associated with a specific BP
JS is the reason there are people fixing the internet non stop around the world just to keep it from failing
well, one of the reasons anyway
I never met the language that stops programmers from making an absolute mess of it. You can shoot yourself in the foot with any gun.
good beginner languages should be strongly typed
sure but there's a difference between shooting yourself with a bb gun or with an rpg
ANYWAYS ZIP I HOPE THIS IS HELPFUL π
One message removed from a suspended account.
srsly...
One message removed from a suspended account.
One message removed from a suspended account.
neither of those things are true lol
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.
This goes against the ideology of OOP.
C++ is over 10 times faster than JS
One message removed from a suspended account.
This shouldn't surprise you btw. JS is a high level language, C++ is midlevel.
Not really sure a C++ versus JS versus BP is really relevant. You don't use JS in UE4. You use BP and C++, and those also have different uses in UE4
If you want to use UE4, those are the tools.
One message removed from a suspended account.
There is a plugin that lets you use JS in UE of course π
10 times as fast is 1000%
One message removed from a suspended account.
One message removed from a suspended account.
Plus just think about it, with Javascript you lose efficiency with dynamic typing, lose efficiency for JIT compilation, lose efficiency because it's VM based. What aspect of C++ should make it slower than JS?
One message removed from a suspended account.
Oof. I don't even want to know how annoying that is to use.
there will always be evil in the world
What can men do against such reckless hate?
Make Discord bots in UE.
One message removed from a suspended account.
Anything is possible.
ninja'd
can we move this to lounge or something?
except going faster than the speed of light. Don't think we've figured that one out yet.
One message removed from a suspended account.
One message removed from a suspended account.
you've all already answered the question which is to use blueprint communication
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.
OnComponentBeginOverlap
depending on how you want it done you can have the coin register itself to the player
All the collision methods return an output for what collider / actor you hit. Check if that's the coin
or have the player just pickup the coin
Or vice versa, yeah
One message removed from a suspended account.
you dont need to bind it
You dont need to bind an event, it's already an event
you need a collision to work with
the engine will call onComponentBeginOverlap for you when appropriate (if your collision is set up correctly)
One message removed from a suspended account.
I mean you need the red one, not the blue one .
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.
One message removed from a suspended account.
One message removed from a suspended account.
generally you select the collider in your Viewport and hit one of these
One message removed from a suspended account.
so select it here, then press the green OnComponentBeginOverlap button on the right
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.
indeed. That will create the correct event WITH the collider already associated with it
is there a simple method for determining if the player is on your right or left side? or should i just make a clockwise detector
in regards to what?
..Dumb question, isn't the player exactly where you are, because you are the player?
One message removed from a suspended account.
So I have bad news: "Left" and "Right" don't exist, they're made up concept s
One message removed from a suspended account.
Split screen?
you can do dot product from the player 1 camera to the player 2 character location, normalized
so basically their relationship to eachother. so i can flip their facing AND their scale (so i can make their right hand become their left hand etc. so their chest is always facing the player.. as opposed to turning their back to you on one side while facing the opponent)
or actually, cross that
hrm my cam is part of the level actually. not attached to player but hmm
So... you don't need left and right
find look at rotation, convert to unit vector, compare between that and camera forward vector
^
so its facing, but also changing their scale on the Y from 1.0 to -1.0 depending on which side they are on. so they always appear the same way
Left and Right are relative to orientation, so you need to find the direction and the orientation
so that's going to give you 1 no matter which side you are on, and -1 if they are behind you
true yea hmm
BUT
One message removed from a suspended account.
actually use the camera right vector
ahh gotcha ok
and you get exactly what you want
might be a good time to watch that vid
1 means right side, -1 means left side
thats cool way to do it. so even tho cam isnt connected to player it still has a right, and since im looking at them from the side, right is always right basically
What's wrong with using the coin's BP? you can just expose a function on the character called AddCoin, then when the coin is collided with it gets a reference to the player actor and calls AddCoin on it
hmm interesting
Any ideas to why is this branch failing (False) when it shouldn't?
One message removed from a suspended account.
the values will fluctuate, if you want it constantly to be either 1 or -1 (or 0, for right in front or behind), use sign
ok. im gonna make some notes then experiment
The input function would check the Coins variable on the player
my guess is there are multiple overlaps happening and one of them produces a fail
One message removed from a suspended account.
That would make sense
print string at overlap, before branch
why dont you use a cast?
To player character?
yes
One message removed from a suspended account.
finally
I thought this would just be quicker. Do you think it could be problematic?
problematic how
Idk in general
yes...
Casting to the player character isn't ever an issue because it's always loaded anyway
Yeah
before we tangent..... the issue is on an overlap misfire
Yes
please check that before getting distracted
I tried with the print string and yes one fire is false
doesn't mean a cast won't fix it
I dont think the cast is the problem
@peak wedge is the question. Sounds like you are suggesting Casting to fix it right?
It is..
You're checking a character reference against and actor reference
If you cast the actor to a character it will pass
yep
I'd print out what you're actually colliding with to make SURE it's what you expect.
figured. @umbral ginkgo did you do a print string literally after the event fires?
Yep
I was considering this as well
But failing that, look I'm not sure exactly how UE handles it but in most languages object equality is a tricky thing
Instance equality isn't tricky. If you get two different pointers to the same instance, it's going to return true, regardless of what pointer level they're cast to.
I'll try the cast anyways
pretty sure this is the exact code for the node
welp
This is my not surprised face π
wait why even bother with the equality then?
I have juest realized that
because the cast goes through
i think you can see how well this works with just event > cast > string
The more dynamic fix would be to save the return from "get player character" to an actor variable and check if that is equal to the "other actor"
still think it wasnt the correct answer @brazen merlin
Also some languages typecheck before running a deeper equality. In that case I wouldn't be surprised if the wildcard object from GetPlayerCharacter doesn't match the specific character class you've got
casting?