#blueprint
402296 messages ยท Page 535 of 403
That would be great for pipelining
They would probably implement text based BP's in YML or something :X
Hi, I'm new to Unreal engine and ive exported a blender model with IDLE and RUN animations into it, and all I have to do now is make the animations occur when moving the model, but the tutorials ive been watching to try and do this aren't really working, any suggestions on how to do it?
Honestly they did say that somewhere
That's one of those nice to haves
I don't see it happening unless for some reason FN needs it
hey guys i need help
i try to repeat 2 video once video 2 of them is finished to play
i want them to be repeated from the first to the second again
how would you animate between holding an object vs not holding an object?
i guess I need to create a separate locomotion node....was thinking maybe there was a smarter way
ah Layered Blend Per Bone might be it
damn still doesn't work
What is the safest way to kill lots of enemy actors all at once? For example. Once I trigger an event, I want all 40+ enemies to die. Should I add every enemy actor that spawns into an array when they first spawn, then remove them if they die normally. Then when I go to trigger my event, I would take that array of all my enemies and do a for each loop and kill each one.
Or should I use the get all actors of class and kill them that way. I never use "get all actors of class" because it seems dangerous especially with lots of enemies.
Ideas?
how is the validated get called for inputs of a function?
so they dont need to connect like this
@dapper kiln event dispatcher or interface
Yea that's what I'd use to let them know to die. I was just unsure what was the safest approach to actually get all of the enemies, whether it be an array or by using "get all actors of class with tag" because I've heard it could be dangerous on performance.
well if you let them know then just call it then
Id probably try using an array and just plugging it into the interface call so it does the for loop automatically, and the interface tells them to die/destroy
@dapper kiln get all actors isnt going to cause a hitch or anything. It's actually not a slow node
So I could add a tag to all my AI called "Enemy" and then use "get all actors of class with tag" and then kill them off
then kill them on the interface call
Yeah. I suppose it comes down to what makes the most sense / what method do you prefer
Basically I just want to wipe out all enemies on my level so I can start fresh in the next area.
no stragglers lol
something like this?
u could do it like that
I'm not saying I'd use this exact interface but you get the point
there are simpler ways
I was just worried about the get all actors node that's all
that would probably be fine though
As far as performance goes, killing 40 actors may have an effect on Garbage Collection (depending on how sophisticated and component-burdened they are) but that's independent of how you go about destroying them. (An object pooling system would mitigate GC impact but that's another layer of complication...)
Majority of things that people say are slow are not slow enough to be a problem
There's a node that has a warning that says "EXTREMELY SLOW", like it literally tells you this if you hover over it
I'm using it in one of my projects and it doesn't cause any noticeable impact at all :)
Get All Actors is weirdly performant for how often Epic says not to use it
If you for-loop and save a Get All Actors array 10,000 times on tick you'll notice it (I've done this out of curiosity once) but short of that ..
I feel like the more specific the actor class, the faster it will run. So Pawn is pretty generic, but say a parent class of Enemy would be more specific
Yeah most of the slow warnings are just there so you know it could cause problems
Just so you are aware of the possibility and know to take care when using it :)
Yea. I get what you guys are saying. Thanks. I was just curios. I like staged boss fights where you fight lots of enemies on stage 1 but then once you kill the boss he gets bigger or something and you fight him in a different area, It would be nice to kill all the small enemies so you can start stage 2 with new enemies
yeah get all actors by some rule and destroy would probably be a good way to do that
Awesome! Thank you guys. ๐ Now somebody help @trim matrix lol He had a question about a node lol. ๐
I found it out
oh hahahaha
I remember some Epic training thing where the death of a boss triggers the deaths of the minions being their example use case for an Event Dispatcher
yeah, depending on how your game works it could also be done with that
So the minions would be bound to the dispatch and once it gets sent out when the boss dies the minions would receive it and die correct?
yeah something like that
Yeah. In that case, the boss wouldn't be aware of the minions... Instead the minions are aware of the boss and are listening for the death event
That makes sense. Then you don't have to have a saved reference for every enemy that you need to kill
yeah event dispatchers can be quite handy for variety of things
I have a system in my game which has phonecalls... there's a dispatcher for when phonecalls come in, but the phonecall object itself also has a dispatcher for when the call ends, etc. - it's a quite elaborate setup but it makes it very flexible
just trying to make ammo drop randomly (sometimes spawns other times doesn't spawn at all) and i cant for the life of me understand arrays and random integers
@vernal ibex what's the problem with this other than the exec pins aren't connected in sequence? :P
nodes that have exec pins run in sequence
so the node that assigns the variable and the node that spawns the actor are completely separate
I don't know what you've connected them into since it's not visible in the pic
thats what i thought first time but they still spawn everytime
they're connected to a event any damage
In this series of videos we will be going over how to create a Horde-like game mode similar to games such as Call of Duty Zombies.
Support me on Patreon and get access to videos early, join our developer community on Discord, get exclusive behind the scenes videos on my proje...
so you want to randomly choose from the list of drop spawn points and then spawn the Goammo there?
or what exactly is the goal here?
when the enemy takes damage and dies there will be an item spawn but only spawn on rare chance
like.. random chance
Right
You could use a branch node instead then
connect it to random boolean with weight
you can then adjust the weight value to adjust how likely it is to spawn
hey guys my camera which is attached to the head is clipping with my hand (holding ball really close to the face). what can I do here?
is it possible to adjust the camera fov?
will that prevent clipping
in the Actor viewport, is it possible to load a specific pose or animation?
Where you are getting the 0 based array
The index will be random from 0 to the length of the array - 1
what do you mean a random node?
No i was saying to @vernal ibex
ah
lol I just made it so the arms never ever cross across the camera....problem solved
Hey, is it possible to get the indexes fo the vertices that make up the face from the face index you get from the linetrace hitresult
hard to say, maybe if it's a procedural mesh? I don't know if BP's have access to mesh data other than for procedural meshes, it might be something you can do in C++
(but I suspect it could still be quite nontrivial)
Hey, is there way to check if some button is held down that is binded to certain action. So can i check if my jump button is down?
something like this but for action mappings
Hey, is there way to check if some button is held down that is binded to certain action. So can i check if my jump button is down?
@wind agate https://youtu.be/QHfQ1_FmA8A
In this tutorial we will learn how to make a key is pressed or being held functionality and you can do interactions accordingly.
Hey! Can anyone advise on how i get data from an Enum into a blueprint please? I can seem to find the right variable type
You want to switch on enums?
hey not sure what you mean.
I'll explain what i want to do
I want to get a list of names from the Enum into a blueprint drop down list so the user can select what interaction type it is (Eg in the Enum list it shows Oak Tree, Maple Tree, Redwood Tree)
You can make enum type variables
its ok I found it, it was right in front of me all this time! thanks for your help though ๐
Anyone know any way of getting all widgets on the player's viewport?
@long smelt Usually by storing them correctly someplace.
@weary jackal Wait, dude is that video just about asking if a button was tapped or held once it's released?....
That's a handy macro
Oh, I thought it was on release at first. Was about to say, that was unnecessarily complicated for that small of a feature.
im trying to pak my game but unreal says it cant find the parent class of my c++ plugin, someone online said change the plugin from developer to runtime but I dont know how does anyone know how to change the plugin from developer to runtime to see if it works ?
never mind my plugin is already in runtime...
bruh, any reason the Capture Thumbnail options is gone for some blueprints, i googled but the answers dont seem to line up with my experience
god almighty, can;t have a visible static mesh as a root, I replaced it with a Scene node but it didn't work, I set the mesh to hidden and it works, ok, that's all a bit awful, because setting the mesh to visible removes the thumbnail
so here's the deal
I have my main menu widget set and everything is fine
but when I start the game, the character actually plays
oh nvm
yeah
when I start the game the character spawn
even tho I have no player start in there
what should I do?
did you check the gamemode? think when the default pawn class is set, a character will spawn also, but in the 0,0,0 position
yes
but when I set the default pawn class to none
the character doesnt play when I press play button
so what should I do
do you want to spawn a character?
I want when I press play the character spawn
not when the game start
also not on all levels
I have main menu level
I dont want the character to spawn there
you can override it in your world settings for each level
How is that?
look in the world settings tab
yeh I Did that
the same thing happens
I press play > the game start I die and I close the game > I see my character moving behind the widget in the main menu map
are you having two levels? menu and game? and when you press play in the menu level you open the game level with default pawn class in game mode?
and in menu level you have another gamemode or override it with the default pawn class to none
hmm, how are you loading the level? open level or load streaming level?
open level
๐ค
I tried doing it from a gamemode
but it crashed the frames to 1 frame per second
idk why
so I deleted everything and went to levels
strange
I am trying to setup a reload animation with this gun I have. I play the animation but Iโm trying to attach the mag to the hand when I do it but donโt know how to. Help? The gun is imported as a Skelton and it has different bones
This is sort of a mixed question but is there a way for me to convert blueprints to C++ to continue working on them from code? (Like, something in the engine itself that does it for me. I know I could just get the functionality and code it myself but that takes away the purpose of creating it through blueprints in the first place)
Basically, I want to create a start menu (using Slate) but a lot of the menu will be loaded dynamically and have custom functions that I want to work on with C++. However, after making the menu through C++ without blueprints, I have decided it would be more efficient for me to make the menu UI itself through blueprints and then add the custom functionality through C++.
I found one article in the UE documentation but it was really vague
@cloud trellis you're going to want to use anim notify's probably to attach to hand at a certain point, then attach back to gun. Or the other way around.
@rigid tartan might be a better question for #cpp , nothing I've seen before will do that though
@restive dagger can you show a screenshot of the code in the game mode for opening a level? Having a pawn spawn in on an event instead of begin play is simple enough
@hollow cape have a vid example?
Cause it plays the animation when I want it to
Itโs just getting the bone of the mag in the gun
To the hand
well let's back up
if the mag is part of the gun, thats going to be a lot harder. You generally want the magazine to be a separate mesh
Well I have it as a separate mesh also
But itโs in the gun skeleton also
And the mag is a different skeleton also
Personally I would set the scale of the magazine bone to 0 (to hide it), and use a separate static mesh of the magazine
this can be attached in BP via a socket on the gun skel mesh
Well I canโt change the skeleton bones at all
yes you can. You can do it in an anim bp
Well I couldnโt destroy it in the actual skeleton but i can try in the animation
in an anim bp, you can use a transform (modify) bone node in the anim graph to set the scale to 0
this is a hacky way to hide a bone
well...hide the geometry associated with a bone
it would have to be an animbp for the gun
since you need to modify the bone of the gun
there are also tons of vids out there related to this exact thing, some googling will probably get you a vid that would help
Where should map generation logic and general handling usually go? I started out by putting it in the level blueprint (just some noise tilemap generation and storing refs to the chunks) but feel it may not be the best place in case I want to call functions on it or retrieve tile data.
Would GameMode be more suitable? Any ideas?
I'll probably always use a single level for the main game world, using a different seed for generation and saving the user modified data separately. That's why I thought the level BP is good but now I need to reference it from the player controller and it feels nasty
in lieu of someone providing a more definitive answer, I'll say that GameMode and GameState exists as built-in manager classes, though I'm not familiar with the functional differences between the two. (GameInstance also exists; it's special because it persists across level loads so it's useful for storing persistent stats.) For each of those, there are readymade functions, GetGameXYZ that make it easy to communicate with.
Yet another option is to put your level generation script into a standalone manager BP that's spawned by GameMode. In my own project, I put too much functionality into GameWhatever and I know I'm going to have to segregate some of it down the road.
The only definitive thing I can say is you shouldn't put fundamental gameplay systems into the Level BP
GameMode seems fine for that sorta stuff imo
Honestly it doesn't make a huge difference where you put it in most cases, these objects exist for developer convenience afterall
Got it, thanks. That helps. I assume GameMode always exists in relation to the player controller so I just grabbed a ref of it to use when needed and moved all the logic there
yup
pop quiz, what does this print, and in what order?
Delay node test first second third?
[0s] Delay Node Test
[2s] Third```
I expected it to show up in the debug tab....but nope
Thanks for everyone's help, deck builder is ugly but works
lol that pop quiz
yeah when the print string at the end of the event is finally called two seconds later, it just gets the last known input string
which by that point is "Third"
I try to avoid making things like that
with parallel latent nodes that are hard to untangle
Can someone help me? I will spawn in an AI and destroy the previous AI and it will spawn it one unit forward
Can someone help please? I set it to get actor location and it still spawns a unit forward
What's the rest of that node? It's cut off in the picture there.
what happens if you check No Collision Fail?
ill see
I never dealt with AI before but spawn-actor nodes have some options for preventing things from telefragging colliding and I wonder if something similar is happening there
that wouldnt work
cuz it might throw errors about doing stuff on an actor that's "marked for destruction"
ideally DestroyActor should be the very last node the actor executes in the graph
I'm actually kind of blown away by that delay node behavior. The mental model is that they're continuations and they'll be queued up to complete
But I guess it's internally just reusing the same timer handle which is a fun surprise
That's certainly a very interesting test case
fwiw, most of those event related things like delays and timers will only run one in parallel per actor
eg. you can't call "set timer by event" twice to start two timers
or to be specific rather, you can't call the same timer twice to do that
you can of course have multiple timers if they are from separate nodes
if I make a blueprint actor (B) with some variables to change a material. and then throw that actor into a new blueprint actor (A)
how can i access the variables from B from A?
Ultimately it comes down to there only being one event; putting a delay on it doesn't let you spawn multiple instances of that event. So the event is firing a few times and updating the "Message" data input, but the execution gets blocked at the Delay node until two seconds later. Then the Print String finally fires and gets the most recent "Message" data.
yeah, I think I'll need to add my own custom delay and timer nodes that avoid this issue
keep a collection of handles etc.
if I needed to do something in parallel with multiples I just made separate actors or widgets or whatever for them
in my cases so far that made sense contextually as well
and not just as a workaround :)
I've got my game mode spawning actors after a delay
@glacial sentinel do you mean in like a child class, or a Child Actor Component?
I think it's a child actor class
you can invoke the "SpawnAnActorInABit" event
this is how my delay-based spawning works :P
It does seem like the actor I'd spawn to deal with this is really just a place to put a timer handle
I'll try experimenting and see what makes sense
@glacial sentinel If you're working on a child class, then you need enable "show inherited variables" to see and modify the parent stuff on the child. You can also override parent functions/events in the Functions section. Admittedly I'm not completely sure what you're asking, so I hope this is it.
Thanks seanny, I think it's a starting point at least for more googling
Just in case you're asking about Child Actor Components, which is literal actor-inside-actor BPs, you have to cast to it in this roundabout way... Your component --> child actor --> cast to your actor class
But for the former (child classes) you should learn about how inheritance works in BP https://youtu.be/tCO0FdibECc (obligatory Mathew W. video)
is there a way to add more inputs for the Event AnyDamage?
https://docs.unrealengine.com/Images/Engine/Blueprints/UserGuide/Events/AnyDamage.webp
Just in case you're asking about Child Actor Components, which is literal actor-inside-actor BPs, you have to cast to it in this roundabout way... Your component --> child actor --> cast to your actor class
@tight schooner yup, I'm doing actor inside actor, where the child actor has some BP that lets me change color on a material
Hey! Is there away I can display the Names in an Enum as a list please?
so it displays
Tree
Stone
Cat
Dog
type thing
ok scrap that managed to do it with a "ForEachEnum" now I'd like to be able to create a button on the hud for each enum value listen
awesome thanks !@atomic salmon Ill check it out ๐ really appreciate it!
@sour ridge Don't think so
what is the basic method of making a player hang from a rope. no idea where to start
Hey so anyone think they could help me with something. I have this relaod animation for a gun, and it plays. I also have the gun imported as a skeleton with the mag as a bone. how do i connect the mag to the hand to get rid of it and add a new one
@maiden burrow The way I would do that would be to have a hanging animation, and attach the hand-bones to the rope.
@cloud trellis Best way I could think to do this would be to use the "AttachActortoComponent" node. You can specify a socket for that (the bone), and attach it to the hand during your reload animation.
yeah but heres the thing
the mag is in the skeleton
but its a bone
and i cant remove it
and there is a mag but it isnt a skeleton
its a static i think
yeah its a static
but i cant remove it
from the skeleton @desert storm
Hm. I'm actually not sure about that one.
hey guys I wanted to know if there is a way to a 2D player shrink with a press of a button
Does anyone knows how to break from a sequence node ?
I would like to stop the sequence actions if a condition hits false
Hello everybody,
Iโm quite new to UE4 BP programming so bear with me if Iโm asking a stupid question. I took some time to look around the internet but didnโt find an answer so far.
Issue:
Iโm receiving some rotation value from an external software to UE4 in an Axis-angle representation: https://en.wikipedia.org/wiki/Axisโangle_representation
I would like to know how I can convert those values within a Blueprint to a rotator that can be used to influence an actor or mesh (Yaw, Pitch, Roll).
Iโve discovered this node: Rotator from Axis angle but Iโm not sure on how to split my vector to get an axis and an angle separately: https://docs.unrealengine.com/en-US/BlueprintAPI/Math/Vector/RotatorfromAxisandAngle/index.html
Any help will be appreciated,
Thank you for your time
Rotator from Axis and Angle
@frozen dune I can only think of convoluted ideas, like putting a gate node in front of each line of execution and closing them en masse, or setting a boolean variable and putting a bunch of branch nodes etc..
Organizationally maybe don't use a sequence in that case. Maybe split up your execution by using events or w/e
oic
but after realizing that, I noticed it would give me an unwanted behavior
One question about menus, if I do a regular menu with 3 buttons, does UE4 automatically makes it work with controllers ?
I had to look into it the other day. It works automagically in a way that's hard to customize. Look into UMG "keyboard focus"
If you set on widget "construction" a button to be focused, then you can do stuff with keyboard arrows and gamepads
Unfortunately anything like a virtual thumbstick cursor needs a plugin to work
because you have to fake the mouse clicks lol
yeah, what I'm thinking is that I would like for the player to be able to use mouse/keyboard/controller in the menus
since I'm prototyping a RPG, the menus are the gameplay itself
With blueprints is it "separated" in a sense between the visual/animation side of it and then the actual mechanics? Are there any tutorials focusing on all of these aspects? Hard to find a comprehensive full blueprint tutorial.
@warm pivot you can do procedural animation driven by BP script that sets object transforms, material & particle effect parameters, and etc.
oh really? interesting to note
Curve assets and Timeline components can drive things with predefined curves, and/or you can drive stuff with math directly
And then there's #legacy-physics which I'm not very familiar with
If I recall correctly, "Kine" is a solo indie game made entirely with BP script, with all the animation driven by BP as well
really wish I could use cascadeur a physics based animation program to directly link it to BP scripts
I know you can import it into UE4 but to my knowledge only via pre-determined animations and nothing more
What node do you use to stop the velocity of an object completely?
I'm almost certain that the pawn class has a velocity parameter so that would be a way
now, if it's any object at all, I think it would depend how you're even setting that velocity
I keep using Event_Tick to set Delta_Time (Float) in multiple BluePrints, then using events to control functionality in my actors. Is there a better way to keep track of Delta_Time Universally without an expensive Cast node, or am I doing this the most efficient way?
All I can find is "Get World Delta Seconds" - which I'm assuming is it. Thanks @twilit heath ๐
has anyone done any winged flight stuff before? I'm trying to get it to evaluate pitch before roll. is this how you'd do it?
I feel like I should be doing this in quaternions in C++
You could do it with quats in BP
aren't they C++ only?
They're actually a BP type
And you can pick up a wrapper lib so you can operate on them
neat
if you prefer to handle XYZW yourself, that comes with the engine
I'd prefer not to but I can't figure out how to do this
with the method above if the pitch is below zero the yaw rotation reverses
I don't understand why. it's not gimbal lock at that stage
I'm basically trying to get it so when you roll 45 degrees and pull up, it's relative to the flying thing
rather than up in world space
the input device has a gyro. we have the pitch and roll absolute values but we don't want the heading obviously, so I'm trying this
damn that shouldn't be the Z pin
I also think I have those last two nodes backwards
I think if you're making a rotator, for this it wants to be YZX, but for adding local transforms it wants to be ZXY. but that's not working.
my function doesnt work if the game is in client mode
any help?
i can get custom events to replicate but functions dont seem to start
Solved-i was calling it inside the custom event
Hey guys looking at making a spawn system manager, is it better practice to use a "zone" to track spawning or can it be level wide, hope that makes sense?
rpg/duegoncrawlers are my intended design target, having a consistent number of AI alive. I'm leaning towards a zone style system , so I can control the type of AI that spawns in a given region but was worried about scalability and if they are separate "zones" how would they know how many the other "zones" had created?
In this series of videos we will be going over how to create a Horde-like game mode similar to games such as Call of Duty Zombies.
Support me on Patreon and get access to videos early, join our developer community on Discord, get exclusive behind the scenes videos on my proje...
Check this out. I think it's what you are lookin
Anyone know the formula to remove the used ammo instead of the whole clip when the player reloads?
You'd have to keep track of how much ammo is in the magazine
After that it's just total ammo - ammo in mag
wait no that not even it lol
total ammo - (mag capacity - ammo in mag)
there you go :P
hey im trying to make a custom camera in my level blueprint for my 3rd person game. probably a very small resolvable issue but would anyone be able to take a look at my blueprint and tell me what i did wrong here.
uploading screen shot in a sec
i want the camera behind the character and to rotate the same degree as the character. but the cam always seems to end up ahead of the character
Whats a nativized BP? is it blueprint code that gets converted to CPP code?
i know that i had a friend drop and drag what looked like some c++ code from a text file into a blueprint and it became a blueprint seamlessly. @wise raven
dont know if that gets you any closer to having your question answered tho sorry.
@earnest tangle Thank you
@wise raven https://docs.unrealengine.com/en-US/Engine/Blueprints/TechnicalGuide/NativizingBlueprints/index.html
In a nutshell, yeah, it's a UE4 feature that converts BP to C++
@tight schooner is it good to nativize all blueprints?
Nativization has bugs so it really depends on your project.
It has to be, like, worth it
lol
If your gamethread specifically is killing your performance, then nativization can have a huge impact
I mean its good to nativize stuff like actors that purely work on tick
like a raycast vehicle
If you have a certain actor that's executing a ton of nodes every frame, or otherwise you have some extremely data-heavy operation, then nativization could help
But you should profile first to see if that blueprint is really adversely affecting performance
before you go down the nativization rabbit hole
I mean how can i check one specific bp profiling?
it shows the entire worlds tick rate and other actors
I think Unreal Insights can do it when configured. I'm not a master at it though. Profiling is kind of a deep subject
I forget if "stat game" in the console gives you that level of granularity
You can also try doing stuff like enabling & disabling an actor and seeing what impact if has on perf in real time
@tight schooner hey bud while youre here do you think you see anything inherently wrong with my blueprint code. my questions was just above nash32's initial comment and it would be awesome if i could get a little feedback.
@tranquil gorge Get your player pawn's forward vector (Get Forward Vector) and multiply that by however many units away you want it to be, and add that to the pawn's location
Also... IDK about level blueprints, but for normal blueprints you can go to the class settings and set the tick rate to something custom if you don't want it to tick every frame
you might actually have to subtract the multiplied forward vector from the pawn's location instead of add it... Figure out which one works
ok thankyou very much i will try this solution. ๐
np
If you want to remove pitch/roll from the equation, I think Get Forward Vector can also be done on a rotator
ah ok ty again
@tight schooner do you know if ue4 auto assigns a camera to the player pawn character without it showing up in components. it seems like even though i have a camera component outside of my pawn blueprint it doesn't want to default to it.
hello is easy ads free version no longer exists? How do you create mobile ads ?
Hey, guys! I've just a very brief question. I need to change the widget texture and I think I found a good solution on unreal forums. But I can't figure out where to find this node, as there's no description in the topic (as if it is obvious for everyone, except myself). So, what is it?
That looks like a widget style structure that has just been broken out
So you'd drag from your widget, then look for "get widget style", then you can right click the pin and choose "split struct pin"
@jade arrow By texture, do you mean an Image widget?
Yep
Just set the Brush. There's a few options for it. Most likely via Texture.
set brush from texture is what I've used so yeah that oughta work
@earnest tangle, I think I got it
Oh, thanks, guys! It just was not obvious at first, especially when you don't even know where to look at
do you use play montage like this to get notify spesific name?
im wondering if i have many notify with different names, the node will be too long
Kinda wish the Instanced specifier was a thing in BP. Would make some modular systems a little easier to work with
What's the best way to clamp a float to some value but have a spring effect, like you clamp it to 50 but it can exceed 50 with exponential falloff so it never goes far above 50?
Depends on your specific use case I guess. You could always use a select. If above 50 use fifty plus equation on remaining amount to keep it in the range you want. If below or == to 50 use that value.
do you use play montage like this to get notify spesific name?
@frigid thicket nvm, didnt know switch on names is a thing
Hi everyone - does anyone have an example of uploading a file via blueprints to an external server? I"m using node as my API and I can deploy formidable or mutler for file uploads, and I can execute JSON requests fine throughout my UE4 project, but the issue is that these "file handler" modules for node require multipart forms, and I'm not sure how I would do that with VaRest or any existing Blueprint tools. Does anyone have any example of file upload to external server via Blueprints? If I could see one example of a file upload in any way from UE4 I could figure out the rest.
Thank you much in advance for any help.
Quick Q, Is there some additional rendering cost to using Canvas Render Targets in a material?
I am using a Canvas Render Target to combine 3 textures at runtime so I can save on texture slots in the material, but I don't want to have it defeat the purpose if they are more expensive
Drawing into a render target isn't cheap
Not drawing to one, that will only happen once
To combine the textures
If it just exists once drawn to, is it still more expensive than a standard texture>
The real issue is that render targets won't have mip-maps
So you'll be locked to the maximum texture size all the time, so there's a good chance it'll be a waste of VRAM
It's probably not worth it tbh
That and the render target will always be loaded, even if nothing is using it
You're better off blending them in material. Render targets are hella expensive
๐ค
I'm prerendering some userwidgets into rendertarget2d's which are then used in materials
I wonder if there's a better way to do that if they're so expensive?
I should note that in my usecase it's one and done, the rendertarget is never updated
@sudden surge Could you elaborate on what part of them is expensive?
if you're doing it via a retainerbox then the best thing to do is ensure it doesnt need to be redrawn. I'm not saying don't ever use them. i'm saying for their use case it's not worth it.
I'll answer your question with another Question. Why use a render target for blending textures in the first place?
what benefit does it give you that say a layererd blend does not?
In my case, I have a character creator with a makeup mask for lips, eyes, cheek, misc using RGBA channels of a texture2d
But I want the player to be able to select lips makeup type, eye makeup type ect individually
The only way I can think to do this would be to use 4 black / white masks so they're all separate texture2ds
But I feel like it's way too much resources for a single makeup system where the body material itself is also using quite a lot of textures
if you set your texture settings correctly that's not a massive issue. there is a texturegroup for masks which is stored as a single channel.
generally if you need to change them individually you'd use seperate assets. it's kinda unavoidable as youd need 4 assets anyway to build your rendertarget
Yeah I'd have separate assets to build the RT but wouldn't it make the material itself less renderheavy? One texture2d vs 4 which are all adding together
Is it possible to set Resolution Scale via BP? I'm on a low-end computer and want to set a default value when the game launches..
Hello, does somebody here know about Teleports?
I have four teleports here. Two on top and two at the bottom. A bit hard to see maybe.
The actors are supposed to teleport from top to bottom and from bottom to top and it works mostly.
But sometimes the Teleport node just returns false and I don't know how to fix it.
Any ideas? Thank you.
It's impossible to say without knowing how you've implemented it
It teleports the actor just far enought that it doesn't interfere with the teleport on the other end.
The branch just determines whether to teleport up or down based on if location Z is positive or negative.
hmm
it's still pretty hard to say, there's nothing in that that would look wrong
maybe you should add some print nodes in there to see what's going on and then try to reproduce the problem and maybe it can give a better idea of what's going on
Yea, I did
Everything is working as expected.
Except Teleport returns false when it doesn't work.
oh, that could be because of a collision I think
if it doesn't fit where it's being teleported and the position can't be adjusted so it fits, then it returns false afaik
if there's enough space, maybe try using draw debug sphere or something to draw a marker where it's attempting to teleport
that should show you if it's going somewhere where it isn't supposed to
Alright, that's a good idea. Thanks zomg.
Hello hello ๐ I just wanted to know if it was possible to save volumes of SoundClasses in the GameUserSettings?
Or should I use my own savefile?
yo anyone here got any good tutorials for an inventory? has to be from 2019 to 2020
Why does it has to be from 2019 to 2020?
cause every tutorial i have tryed havent worked and they where from 2017
Hey guys, quick question what is the difference between "For loop" and "While Loop"?
In this new series I go through a method of creating an inventory system, similar to a survival game. In this first part I introduce the system and go through the process of setting up some key assets that we will need going forward.
There are unlimited ways to create a tutor...
2018 good for you?
@devout geyser For loop runs as many times as you specify
While loops continue while whatever you want is still true
for example while player is alive
So while works in case of a condition? and for just number of loops?
Thanks! have a great day ๐
๐
Hey! Need a bit of advice please ๐ I'm creating a teleporting system and have got it all working with a HUD where you can select a teleporter it then triggers a script to run and find all the teleporters spawned and if it finds one it then teleports the player.
Currently its searching for all the teleporters and there locations. I was wondering if i would be better storing the teleporter locations in a GameInstance rather than a triggered blueprint. I'm not sure if i should be using the GameInstance for this though? Would I better putting it in a database so when a teleporter is dropped in a level it gets the location of it then stores it in a database?
or am i over thinking it
or could i use a construct script inside the Teleporter blueprint that writes the location into the database ready for when the game loads?
You could probably just have an array of teleporters in your gamemode or something
if they are placed into level, you can just get all actors of class and save them into the array on beginplay
if they are spawned dynamically, you can have each teleporter register itself by calling a function on the gamemode (which then puts it into the array)
although if you need to get all currently available teleports to choose from, you could just try using get all actors of class, most likely it will perform adequately
@earnest tangle thanks for the reply! Currently when a Teleporter name is clicked it goes to a blueprint which gets all actors of class and loops through until it finds the matching ID Number of the teleporter the moves the player but I'm not sure if this is very efficient
or if i should not worry about it for now if it works it works and look at effieciency later?
it sounds fine to me if you're not seeing the game lag when doing that :)
@earnest tangle ok i shall keep going then for now ๐ Thanks foir your help!
@frozen hemlock On a side note, running a while loop while the player is alive is probably not the best idea, since loops execute on the cpu thread until they're finished. If you were doing something while the player is alive, it's probably better to consider tick, which would only run once per frame instead of thousands of times per frame.
I'm wondering if there's a way to do asynchronous timed events inside a blueprint. So, e.g. you click mouse twice and each one fires a timer and after each timer reaches zero, you get a thing executed on each occurance.
I'm doing a local multiplayer arena and I want to have invulnerability after a player hits another one, but if another player hits you immediately, they can still damage you. So, independend invulnerabilities for each player.
I imagine that there needs to be some sort of array somewhere dictating that this player is now invulnerable to this player's attacks.
@merry yew Might be easiest to make either a map or an array of structs. One variable being a pointer to the enemy controller or pawn, the other to a float. Then on tick count down that float, if it's 0 then remove it from the map/arrayofstructs. On damage taken, see if there's already an entry for that pawn/controller, if yes, do nothing. if no call your damage function and then add that pawn/controller to the array/map with your float set at your desired invulnerability time.
That's a good idea @maiden wadi , thanks!
any idea why the emitter doesnt work?
Hey again, how i can I do this please. in my Hud i have a button and when its clicked i would like to send a Blueprint interface message. The trouble is I can't seem to figure out that target for the interface. Usually I have used interfaces with line traces
Hi guys, i have a question about function in UE4. I've made a main manu with save and load buttons. When i press the button the function names SaveGame and LoadGame doesn't work. Functions are in main Player blueprint.
In Player bp - works
In widget doesn't work
Maybe you know why?
I'd guess you got an accessed none error @manic gyro?
I don't have any errors
I struggle to think of something that isn't game engine modification. Things that are data/simulation heavy... It's not like you should "never" do it but BP isn't a natural fit for those use cases @spring birch
Is the player reference valid ?
@spring birch Kine is a solo dev game that Epic has shown in a livestream. I haven't played it myself but it seemed competent.
I think so @gentle urchin
How is it set / updated?
Hi um can someone help me?
The crouch on my game is bugging
When i press ctrl it did the crouch but only for 1 sec and then it when back to idle
Make a animation statmachine
Epic's intended use of BP is as a design layer that calls C++ functions, or is used as child classes for C++ parent classes. So use of BP isn't exclusive, though using BP or C++ exclusively can be done. But the normal way to use both, at least for teams. @spring birch
And make a bool is crouched
I love blueprints so much. They have so much power.
Bool? Boolean?
Yea
Ooo okay imma check that
From that boolean it can toggle the crouch pose
@lapis knot you're spawning an attached emitter but is it actually attached to anything?
Maybe just spawn it at a world location and see if that works
@manic gyro is your widget is 'IsFocusable'?
Yeah that could aslo be a thing. Make sure the event fires in the first place
@gentle urchin Idk, i've made a variable from my Player_Bp, and called functions from this variable if you are asking about this. Player_Bp is my main Bp. When I called functions in Player Bp it works, but when i try called function in widget it not even start
@weary jackal i didn't hear about this
The variable has to be updated with a valid reference aswell. By default its an empty variable.
@lapis knot you're spawning an attached emitter but is it actually attached to anything?
@tight schooner
Its attached to the laser no?
@weary jackal i didn't hear about this
@manic gyro if you don't have the widget 'IsFocusable' then you can't do the interaction from the widget
Accessed none?
It's in the widget's designer window, under the palette you can see the hierarchy. Click on the root of the widget. You can see 'IsFocusable' in details panel
Also make sure the input mode to ui
And vice-versa toggling
I found the opctin isfocusable but i don't see the vice versa toggling
Yes it is
Also when you open your ui you should make the input mode to ui only
And when you remove from the parent, you should set input mode to game
I have this. Main menu is working, i can go to onother options etc. but only two buttons to save and load game doesn't work.
Add a print at the button pressed to make sure the event fires in the first place
Try the calling of savegame function before removing widget from parent
Ohhh lol i didnt even check for that
I've made both of this things
But i would think the rest still would execute
Still doesn't work.
So you added a print, and there's nothing printing when you press the button ?
Drag out from player variable, get displayname, and plug that into the print
Does it still print ?
Hey guys, quick question, when i use the foliage tool i can't see my brush, any suggestion on how to fix it?
Hello, I'm trying to move camera while the simulation is paused, but doesn't work. Anyone can help me please, thanks a lot
you need to play, to move the camera not to simulate @tiny ember
So i have a camera attached to a TPS side view character (spring arm + cam)
any way to make to so that the camera does not follow the up/down postition of character?
You could probably use a separate camera actor or something which follows only on the axes you want
otherwise you'd have to keep moving the position of the spring arm component relative to where the character is
maybe i can adjust the spring arm offset
alright thx
alright using event tick + socket offset worked nicely
@sacred current Can you show the variable returning function?
Is blueprint the context I should work in to fetch color data from an imported Alembic?
I want to route that information to the color input of a material.
Hey guys I want to know is there a way to compare two wildcard like which one is bigger ?
you probably can't with wildcards, because a wildcard could be any type, including types that cannot be compared for size
I wanted to do this so I could compare these variables float , integer and transform but I don't want to make function for each one
Hi, is there any particular advantage of using event dispatcher? I've been using UE4 for almost 5 years and I have never used it.
You can bind and unbind to events at runtime, for one
It's basically the same as a listener pattern
I use them quite extensively to trigger things when stuff happens
"Observer" design pattern
For example when my characters complete an animation they trigger a dispatcher etc.
what is the alternative to timeline to use in other blueprints ? I want to create a bouncing effect on my camera and I want to create a graph like i can create with timeline but it isn't available in normal blueprints other than materials
@sour aspen make a curve asset?
Helps you decouple your code, as once you expose an event, other classes can bind to that event without you needing to change the class with the event dispatcher, or for it to know the listening classes exist
@tight schooner a curve asset never heard of them I'll search it thanks
@sour aspen why isn't the timeline available?
@thorny relic its onyl available in material blueprints
Note that you can only use timelines in the event graph, not inside functions
hmm that sucks I was trying to use it in fucn
Timeline is available in all blueprint types, just not inside functions - I use them a lot, they're awesome
ohh that's what it was about, yeah it doesn't work in funcs :)
@sour aspen obligatory Mathew W. video https://youtu.be/HrHFpAxnBZQ
You can add a custom event instead of using a function
@thorny relic they don't actually work in UObject based BP's and some other limitations
@tight schooner thanks
you can make a function that samples a curve, but you can't make a function that continuously fires over time like a Timeline does
@thorny relic but isn't it make my project more complicated? I am coming from Java background so I dont like using custom events feels like adding all the methods to in the main class :S
@tight schooner Hmm I see, after I get the grasp of the curves I can decide what to do
it's best not to think about it too much lol
custom events are very handy in some cases
since you can use nodes like delays and timelines in them :)
basically functions are in a different scope that doesn't have access to the time simulation
fwiw if you want to run a timeline from a function, you can call a custom event from your function, which then in turn triggers the timeline
but at that point you might as well just have the function be a custom event instead imo
Yes... also, an event is basically a function that doesn't return anything, anyway
yeah, that's probably the best way to think about it :)
In fact, overriding a no-return function from a parent class will turn it into an event handler
I don't get the scopes of these things. Is it private or public maybe protected? Feels weird
(Which always felt slightly odd to me...)
@sour aspen custom events are public always
it's a bit meh but you get used to it :P
Blueprint doesn't really do that scope stuff very well
it does with functions :)
I want to move to c++ but since this is my first project I wanted to go with the easy way
my advice would be to not worry about "proper software engineering practices" too much :)
I am also not very familiar with c++ so I am trying to improve with little steps
just do it the unreal way and things will be much more straightforward
๐ Okay I'll keep that in mind
Can't you still call them from other blueprints? I thought you could even if you marked the function private, but I might be misremembering
nah, protected and private for functions works as you'd expect, as in same as in C++
Aha, maybe I was thinking of something else then
Also @sour aspen , it's quite viable to use blueprints for most things and a little bit of C++ for when you need it, in custom nodes you can call from BP
so that's probably your best way to learn
@thorny relic I am afraid of adding c++ to my bp project because i think it messes up the project folders whenever I tried to ad only a c++ class it confused me and i had to roll back
it should work fine tbh
at least all my stuff was BP first and then I added C++ into it and it works :)
A question:
I have a c++ base class that sets values for some UProperties (they're UAttributeSets), I have a blueprint created from that class, that now has correct values in it, but a blueprint that as parented to that blueprint, contains None in the properties that are supposed to be filled with some value. What's going on and how to fix it?
I often experience issues with compiling the c++ project in the first place, randomly getting errors after a restart. Like not finding included files etc all of a sudden ๐
probably me doing it wrong but...
@peak otter Wait so you have CppBase, and BpChild, and in BpChild the values that are set as defaults in CppBase are the wrong values?
Cpp Base (in ctor: MyAttributeSet = NewDefaultSubobject<UMyAttributeSet>) ->BpBase (MyAttributeSet points to newly created object) -> BpChild(MyAttributeSet is None)
Ah
Never ran into that, I wonder if it's something to do with NewDefautlSubobject ๐ค
its almost like None value is serialized somehow and not willing to be overwritten
Funnily enough when I create BpChild2 now it contains correct values too
so something is wrong with that one particular blueprint
Have you tried if you can reset the value of the variable back to the default in BpChild? Ie. with the little "reset to default" arrow that you get on vars that have changes from their defaults
hey guys!
I'm looking for a way to constrain movement of my player pawn. I found "Constraint to plane"-Options in the character movement component but I'm not getting it atm^^
...goal is to be able to just move along the Z axis to climb ladders for example
@sudden spear its kindof dirty but when I enter a ladder I would write down that ladder direction (not just Z up vector so you could have slanted ladders) and as long as the player is on the ladder, I would project his position onto that vector
look at "Find closest point on line"
@sick galleon thank you! I'll try that :)
...but I'd like also to know how I could achieve this with a "constraint logic" if anybody knows ๐
There are the physical body axis constraints, with "Set Constraint Mode" but I guess thats what you already used, and it doesnt seem to offer per axis constraint
I used the "Set Plane Constraint Axis Setting" now which you can see on the pic. It kinda works but I'm still able to strafe on the ladder.
...btw I was thinking of the ladder movement in Half Life 1. There's just still the problem that I have to figure out when I'm at the top of the ladder and want to go "forward" towards the top
how can i change an created widget size? i tried with set desired size in viewport but whole widget get screw up
is it better to fetch data for a bp from the datatable when needed, or from the bp itself? (given the bp fetched that data and set it internally from the datatable OnBeginPlay)
Depends on the datatable. If it's just a single entry occasionally, you probably won't notice much. If you're regularly pulling hundreds of entries, definitely do it once and put the data in an array to use. BP findrow is a bit slow.
Ahh.. i guess that makes sense. FindRow would need to loop over the items in the datatable.
and if I have many items, then it is going to take up cpu power
@maiden wadi Thanks!
Well i don't know why but when i start my game it seems like i have two camera?
It causes me to get the wrong camera actor to work with in runtime
Also creating unnecessary cameraActor :S
did you drag one into the world, and then spawn one ?
Well i have one but I dont remember spawning any camera in blueprint
@sudden spear iirc in half-life, ladder logic was "while the player is in the volume, if he's going forward and collides with something : he goes up if he's aiming above the horizon, otherwise he goes down. Strafing was allowed so you could get out of the ladder volume on the sides. Ofc, gravity not affecting the player at that point.
unrelated question :
How can I get a material from a string in BP ?
I have something like "/Game/Materials/Craftable.Craftable" that I got from "Get Path Name"
How can I get a material variable from that path name ?
Hello!
I have a spline and building grid that is being generated inside this spline. Generation is a recursive function in actor that checks four sides around this actor; function stops executing when the space inside the spline is full.
I want to have a visual display of the grid in the editor including its' changes that happen whenever the spline is changes; right now I can see it only in game. I tried moving main logic from EventGraph to ConstructionScript but the engine can't process the recursion and it causes Error: Infinite Loop. I tried increasing max loop iteration count in project settings but it didn't help at all. If someone has worked with a task like that before or knows how to put the recursion into ConstructionSctript it would be great if you shared you knowledge.
Thanks in adance!
@sick galleon that is interesting! :)
I did it now like this in my player charachter BP: ("OnLadder" bool is true when I enter the box collision of the ladder; when I hit jump "OnLadder" bool is false and I'm able to walk again without constraints) ...though I still have trouble because I'm not able to go up the Z axis immediately when I enter the box collision but I'm going to figure that out ๐
@sick galleon maybe a soft object reference? I never played with it so I'm only vaguely aware of the system
I do notice there's a "Make soft object path" node that takes a string
so maybe there's some way to resolve that into a "hard" object reference
Epic has a livestream about that... https://youtu.be/K0ENnLV19Cw?t=1575
(which I haven't watched yet)
lol
well, I suppose you'd have to use the Completed exec pin, but otherwise. No idea if that'll work.
Anyone familiar with tutorials/guides on player movement in ue4? I keep finding "AI" movement which I do not need for a first person dungeon crawler, just need to find a way to get the player to match the height of the floor mesh. (the z axis, x-y axes should be straightofrward)
Hey everyone, im trying to make my character spin in air when pressing a button.
Its supposed to just rotate its body slowly 360 degrees and stop after like 1 second.
But it keeps going too fast and spinning more than once.
It also doesnt spin 360 completely, the character ends up crooked at the end of the spin and just looks weird.
I need help trying to do this with Timeline because thats what im using.
@hoary gazelle There are two, somewhat unrelated problems. One of them is a timeline curve is adding rather than setting an offset which will produce crazy results and there are two ways to fix that. Either use a "set" node instead of an "add", or keep using the AddRelativeRotation node but don't use a curve at all, and instead feed it with GetWorldDeltaSeconds * 360 (or w/e)
So that's one problem. The second problem I can't give specific advice for, but the crux of the issue is "gimbal lock"
which is what happens with 3D (i.e. vector 3) rotators when you flip a thing upside down
The solution may be to use quaternions which can be enabled in the editor plugins, I think... but I never used them personally so yeah, I can't give specific advice for that.
You can at least test the solution to the first problem by using "yaw" because that won't suffer from gimbal lock
So, SetRelativeRotation seems to be the best option here, however it also sets the rotation of all the offsets.
So as its twirling, it rotates the players X and Z as well because now everytime i move right, the player faces towards the camera.
I should also mention this is a side scroller, if that makes any difference.
I'll just say that every frame, your timeline is calling AddRelativeRotation, and each frame, the curve is feeding it a larger number
so early on, it's adding rotations of 1, 2, etc.
but by the end, it's adding rotations closer to 360 per frame
so it's hard to meaningfully use AddRelativeRotation on a "ticked" event like a timeline without factoring in WorldDeltaSeconds (which is 1 รท frame rate)
and the curve, if you even want to use a curve, is more like the rotation speed
Build powerful visual scripts without code.
This post mentions a BP Profiler.
Anyone know where I can find it?
Or any tuts on using it.
An overview on the Profiler Tool used to monitor game performance.
can someone help me?
i have a top down game with shooting and enemies
and when my enemies die they ragdoll, and dissapear in 3 seconds
which is what i want, however
when they ragdoll, their bodies still have physics
in a way that they block the path of other enemies
so i was wondering if its possible to make it so that on death the collision changes so it DOESNT fall through the floor, but the players CAN walk throught it?
@tight schooner this soft object reference looks promising, ill try that, thanks
@void cobalt turn off collisions and gravity
that makes the bodies fall throught the floor
wait
yea no that doesnt work
oh
i did it
ended up setting collision preset to ragdoll
and that did it perfectly
how do i change the size of a 2D character using blueprint
how do I get blueprint session result?, I know find session exists though how do you get your session after you host it for ref, thanks
Hey guys! Does anyone know of any tutorials for commanding ai as a player character? This would be similar to games such as ghost recon wildlands where you can order the ai to hold position or attack a target.
@true plaza I'm pretty sure you need to use "try get pawn" or something like that
@barren relic Nothing specific comes to mind, but you should be able to add you ai to an array or map and then call function and pass arguments that way
@hardy swallow still failing. maybe Im casting to the wrong thing? but thats where my bool is
@true plaza Something I use a lot is GetDisplayName->PrintString. If you call that on GetPlayerPawn or TryGetPawn, it'll at least tell you what it's trying to pass, if anything.
And it's TryGetPawnOwner, not TryGetPawn, sorry
@queen wyvern Unless you're trying to set up some super specific Jump action, why not just use what comes in the character default?
I do not understand what is happening here. For some reason this variable is not setting. I've never encountered this issue before. What would make a variable either not set or unset?
but it wont jump eventually lol
What do you mean "very rough" Like, the animation
yaa
That's not really something you can magic away through blueprints. That's more of the animators job. You can change things like transition speed and stuff like that, but that's also going to be in the character's animation blueprint
hm so ill just reset back the settings then?
I would, then go to the animation BP and (give me a sec)
And look at the transition rules. You can also go to the animations being called and play around with Rate Scale, Interpolation; settings in there. I'm sure there's a better way to do all this, but messing around is how I've learned most of what I know
@quasi frost First off, I'm not sure what's going on. Second, damn that's a lot of if-else statement. I know it's not going to solve your issue, but check out the Select node; it'll make that much cleaner
hey all, i'm having a bit of issue with a save file im trying to make and I think i'm missing something. My end goal is to be able to generate a struct made out of a random mesh and material, and add that struct to an array that is saved and can be loaded later. right now, it's overwriting the first value every time. any advice? lol
@hardy swallow For some reason the first circled variable is not setting the second. The first prints correct and the second prints none
@quasi frost Check the order of execution. An easy way to do this is be throwing Print String which print out numbers in the order you think they should fire in. A better way to this is with breakpoints, but if you don't know them, print strings work fine
@hardy swallow Hmm how would this execute out of order? And if it was how would I even fix that?
Where is StoredCard being set?
Also, it looks like you're using that variable for each slot, so change the slot to slot 2, or any other than 1, and see if the same thing happens
It's odd this should be super simple. I an grabbing the card name of the selected card, and setting the card in the deck to the same name. It's odd that this is giving me so much issue lol
Can you highlight everything in that comment, paste and save it in a text file, and DM it to me?
hey all, i'm having a bit of issue with a save file im trying to make and I think i'm missing something. My end goal is to be able to generate a struct made out of a random mesh and material, and add that struct to an array that is saved and can be loaded later. right now, it's overwriting the first value every time. any advice? lol
this is the main bit of blueprint that i think might be causing the issue. also, the 'saved stars' array doesn't have any default values if that matters
@devout kelp You're pulling SavedStars from SaveStarsInstance, which might be pulling a copy and adding it to that copy instead of pulling a reference, which would directly change the variable. What you might have to do is pull that array, promote it to a local variable, then add it to that local variable, then call SetSavedStars from your SaveStarsInstance, then after all that save the game.
oh, that might do it. thank you! i'll give it a shot
dang, both GetDisplayName functions dont seem to be working for me @hardy swallow
not seeing anything print or in the msg log
Here's something that might blow your mind: do you have that animation blueprint open (in view) when you try to play your game? If so, for whatever reason, it probably won't work. I've ran into that a lot.
is this what you meant? currently, its still overwriting the 0 index instead of adding
Try AddUnique instead of Add
I also assume you're loading the game, promoting that to a variable (Starsave Instance), changing it, then saving that again, right?
oh my god. i wasnt loading the game
thats probably the issue then
How do you copy an actor in blueprint? Basically I want to make it so when you pick up a gun it will copy all of the gun class into a gun class variable the player has, so I can delete the gun on the ground.
thank you @hardy swallow that totally solved it. i just. completely forgot to load the game in this blueprint and didn't notice lmao
@ionic gull What I'd do is not have the gun on the ground be the same as the gun your player gets. Instead, have that as just a plain actor with a "OnBeginOverlap" or something, and have the gun class you want to spawn as a variable in there, and when your player overlaps, it passes that variable to the player then deletes itself
@devout kelp It happens. I run into a lot of "why isn't this working" then realize I'm never calling the function in the first place
@hardy swallow hmm that could work, the only problem is that I will likely have to transfer a decent amount of variables from one to the other, such as if one gun only has 20 bullets left in its reserves, or if a gun has the sniper scope attachment, etc etc
Has anyone ever uploaded files (such as an image) to a remote API using Blue prints (via VaRest or another means)?
@ionic gull So, the gun on the ground can have different properties than it's base class? In that case, have the class variable like I said, but also make a struct containing all that info and have that as a variable as well. In your gun's base class, have that same struct as "instance editable" and "expose on spawn" then pass both the class var and the struct from the gun on the ground to your character, so now they have both the class and it's many variables. If you're going to have the same base class (let's say Handgun) but with different struct variables (lets say Red Dot Sight and Laser Sight), then you should look into making a map of structs. Also, a struct can contain a different struct as one of its variables.
@hardy swallow got Get Display Name working and see now that it is casting to the wrong pawn (also not sure why it throws a Fail though)
@hardy swallow Awesome that is exactly what I was looking for, thank you!
Np
@true plaza So, the cast fails since it's casting to the wrong pawn... which makes sense, it should do that. idk man...
just to make sure it's clear, I need a bool from MotionControllerPawn, so I cast to that from animationBP and use TryGetPawnOwner
I mean, MotionControllerPawn is using the anim BP, like, it's assigned right? I don't see why that would fail if that's the case.
its not
an AI pawn is using the anim BP
thats the one showing up
do I need to cast to something different then?
Is this for vr? @true plaza
yes
And its for the player controllers?
not exactly sure what you mean
Like the controllers for the hands
Maybe try getting player controller as the object?
@true plaza Wait... yeah, if MotionControllerPawn isn't using the anim BP, then of course you won't be able to use TryGetPawnOwner, because it's, well, going to return the pawn owner. Is MotionControllerPawn controlled by the player controller?
If that's the case, do GetPlayerController(0)->GetControlledPawn->CastToMotionControllerPawn
that works :o
Yay!
nice
For things like stats (health, mana, strength, dex, luck, etc), is it recommended to use struct to hold them then add it to your Character, or is it better to use ActorComponent then add it to your character?
It depends if those are things which are going to be used in other places. So, if your enemies are going to have health, mana, strength, etc. then yeah, you'd want to go with an actor component. The other benefit to using the component is that you can use that as a container for various functions which you can call from the owning actor, that way you don't have to rewrite those functions in every character which uses those stats. @pale blade
Hm, so like if I want non-Actor items to reuse the Stats, then I'd want a struct?
Well, Actor is the base class of anything you place in the world, so do you mean non-character?
Like a book
Like I said, since Actor is the base class of any placeable object, you can still use an actor component and just not call certain things. Granted, if you have a bunch of those, then you're just using up data and memory.
In my game, all my playable characters have a Health actor component which deals with taking/healing damage, but the exploding barrel has the same component, I just never call the Heal Damage function from the barrel
Hm, I see
The only thing is, if you have a Stats component which has a bunch of data and a bunch of functions which handle that data, then you wouldn't want to use that on everything that can take damage (which is just a small part of the Stats component) and the reason is because that means every fish, dog, box, whatever would have that data, which can take up a lot of memory when you have a lot of those in the scene
Got it
Is there no easy way to subtract rotators?
Is there an invert or negate rotator? You can invert one rotator and then Combine Rotators
hey guys. I had a project that the skysphere was working properly in game , but for somereason when i play the game in standalone or a new window the skysphere isn't working and the colours are a bit off.
does anyone know whats going on"?
Hello friends!
I'm working on a project that utilizes a magnet to push around large metal cubes
When you left click, the cubes come towards you, when you right click they're pushed away
To make this work, I need to check if the player is within a certain proximity of the cube, and then check if a mouse button is held down
There's a couple things that confuse me though
So I believe that I would want to use "On Component Begin Overlap", right?
so, as a bit of an example
If it's mouse driven, you may as well start with the mouse click. You do some sort of click-to-line-trace thing to determine what object was clicked on. You then get that object's world location (or use the trace hit location) and use a Distance node with the player pawn. Then you can determine how far away the clicked object is.
I have this?
The goal isn't so much that the player has to aim at it, but just as a general proximity
I'm not sure if your game is camera/reticle based or cursor based. If it's the former, you can do a line trace out of the camera rotation. Actually a simpler way than doing the distance check is just limit the length of the line trace to begin with 
reticle based, but without a reticle
lol
It's a non-directional magnet
Electromagnet, rather
yup
I suppose you can do a sphere overlap actors node (I may not have the exact node name... just going from memory here)
and get the list of overlapping actors, figure out some way to filter them by interactivity, and affect those
Put that on the cube?
I assume the player is holding the magnet, so you'd want the functionality on the player pawn
in that case.
yup
Upon mouse click, get a list of actors from sphere-overlaps-actors and... do something to them, lol. (I'm not a UE4 physics expert.)
I'm playing around right now, trying to figure out what you mean D:
SphereOverlapActors
Connect that node to Left Mouse Button Pressed
That's an easy way to do an overlap check without making a collision component
Set the sphere position to the pawn (GetActorLocation node)
Set the radius to whatever you want the magnet range to be
Object Types... Drag that pin out and type "Make", and you can specify stuff that way.
I'm doing it right now as I read, I apologize for my inexperience
Actor Class... Whatever type of object you want it to find
(knowledge of class inheritance and the hierarchy helps there)
Actors to Ignore... Drag that pin out, type Make, and feed the Make Array node a "self" node.
So that it doesn't find the player pawn
Drag "Out Actors" and connect it to a ForEachLoop
like so?
Cuz the out actors is an "array" (list) of actors it found
So for each of those actors in the list you want to do something
I don'ot understand what the Object Types is
Those might be collision channels.... I kinda forget. I'm going by memory
But if the options are like WorldStatic and WorldDynamic then it's collision channels
Probably. I would guess your boxes are that
They're StaticMeshActors currently but idk if they shouldn't be
I don't know about those offhand. If they have a physics section in the details panel
You might see if they're WorldDynamic or something
By the way, thank you so much
And if that's the case, you should set your SphereOverlapActors to that
You have no idea how much this means to me
Np :)
Hm, doesn't say anywhere
You'll have to figure out the magnetic effect on your own though (unless someone else chimes in)... I haven't done much interactive physics
Anyway let's just go with dynamic
On the ForEachLoop, attach a print string node to the Loop execution pin
And on that ForEachLoop, drag out the uh, output data pin (I forget what it calls it), and search for ToString
And then attach the output of that to the PrintString string input
And if all goes well, when you click the mouse in your game, it'll print a list of overlapped actors to your screen
Yeah... Do the rest of it too
Right now :)P
Loop Body into Print String. Array Element into ToString and then into the PrintString node
(and don't forget to connect SphereOverlapActors to ForEachLoop)
You forgot to connect the execution from SphereOverlapActors to ForEachLoop
But otherwise yeah
Then try walking up to the boxes and clicking the mouse and hopefully it finds them and prints their object names to the screen
didn't work :(
Dang. Well, you can try expanding the object Types to just include everything possible lol
Idk what the boxes are without seeing their collision settings
In collision section, click that sneaky down arrow at the bottom of it
It should reveal the collision channel / object type
It just says that it's relevant for level bounds
Oh, is there a mesh component in it?
Or a collision component? You have to check that
It could be the thing with the house icon
Sometimes meshes have collision objects/settings in them
Would it function better if it were a sphere?
It should be unmovable by anything other than the magnet
If it's fundamentally not collide-able then SphereOverlapActors won't find it, because it uses the physics system to find stuff. The box has to be responsive to overlap checks at the least
If it's a BP, then the collide-able part can be in a collision component or a static mesh.
If it's not a BP, and it's just a straight up static mesh, then you need to open the mesh, and set up some collision on it
Or else it won't respond to overlap checks much less physical forces
My knowledge of physics is slim so thats about as far as I can help you
Can I not manually add Character Movement Component myself?
I understand the Actor - Pawn - Character structure and I want to make a Custom Pawn (special functionality) but eventually inherit Custom Pawn to Custom Character
Of course I can't use the default Character anymore, since I'm using Custom Pawn
I'm struggling right now with some stuff, but I'm going to go to sleep Seanny. It's 3:30am :D
Goodnight
Hello , i'm running into a weird issue that i hope i can get some help with , i have a function that sets the mouse cursor world position, this works fine in PIE but when i package or play in standalone it doesn't i'm scratching my head over what's breaking it but i can't seem to understand what the problem is
Selecting a "LookAt" node in an anim BP freezes the editor indefinitely and causes memory spikes. Can't even delete the node to fix the issue to keep it from freezing the whole engine.
Was just wondering if anyone else has experienced this?
@narrow wyvern Feel free to ask on the #legacy-physics channel if you need help with magnetic forces and the like. That's where most of the physics/math discussions take place.
@vast lion not supposed to do that. Maybe you have a kind of looping condition going on? Where one bone looks at another and viceversa?
Hmm, I looked for loops
All I have to do is highlight the LookAt node and then the whole editor freezes
Thanks for the suggestion though!
what ue version?
4.25.3
interesting, not happening to me
Yeah, doesn't happen in a new blank project for me either
Hey Guys, Any ideas why previously my save file was in the Game Folder and now it's in App DAta?
does Async Save and Save not storing at the same place?
if you didn't change something
its probably because you packaged the game and saved from there
@worthy frost hot reload is enabled, but I'm not using a hot reloaded binary
Will try disabling it entirely
guys why when i attach to a socket then it changes its location?
Now the entire editor won't open. Get's stuck at 95% until the system is out of memory...
time to revert that BP from source control
Can anyone give me any indication why this wouldnt work? Im trying to set an image to a texture for an inventory slot. The Item being passed in is valid but when I GetItemThumbnail the Texture is not valid
What if you don't use SC
SetBrushFromTexture works only after widget is already on screen for some reason
@daring wagon
anything after construct is fine
you can expose on spawn and do it on construct, for one
not sure how you managed to give it a stroke with blueprints alone, that usually requires c++
Possibly because im using C++ as well
oh nice
basically
cache the thumbnail
and run another setbrush from construct
should do the trick
hi can someone help me?
the idle animation is diffrent lol
i put the the standing idle but it comes out aiming idle
Hey! I have a spline mesh blueprint i've created and need advice please. How would i get it to randomise the set mesh for each spline point please?
I created a variable in an actor of type Object->ClassReference, but I can't assign it the "value" of DataAsset class. Why is that?
data assets are considered to be instances (I think)
have you tried using that instead of class ref?
What do you mean? they have a type. UDataAsset. I need that.
Are you trying to assign a specific data asset to the variable as the default or what exactly?
no. It's an editor event that gets an asset and maps the asset based on the type of it.
Ah right, so you want to assign the class and not the instance?
If so it seems like it should work if it's Object->Class Ref ๐ค UDataAsset does inherit from UObject
yup :\ I'm guessing it's the MinimalApi on it actually ๐ฆ
Could you use DataAsset->Class Ref instead as the type?
that's a good question :P
primary data asset might work?
at least if your data assets are created in blueprints, they would have to be based on primary data asset
you can only create "plain" data assets in C++ afaik
I can't assign primary data asset neither though :\
it seems to work for me ๐ค
that's not what I meant; you're declaring a variable from that type.
I need to assign that type to a generic variable (e.g. of object type of Class)
I assume there's some reason why you can't make the variable of that type?
Sounds like this is something that might be possible to do with C++ and the type system limits in BP are getting in the way :)
I assume there's some reason why you can't make the variable of that type?
@earnest tangle Like I said, It's an editor event and I'm dealing with assets. I'm getting an Object, and I need to map it from the type of it.
Creating a variable from type DataAsset will do nothing
Yeah sounds like C++ might be the way to go.. you can do all kinds of shenanigans there with types lol
Hi,
I want to create a different camera for the FPS weapons and elements which show the gun and hands with a fixed FOV so that my animations dont look bad when I change the FOV of the main camera. See this video from 3:36 to know more - https://www.youtube.com/watch?v=dclA9iwZB_s&t=193s
I also want the weapon not to go throught walls when we are close to them. This is implemented in almost every FPS game and it works very well.
How can I achieve in UE4? Thanks
Watch 100s of Blender tutorials - start your FREE trial on http://www.cgcookie.com
Before we dive into all the technical stuff about how to set up the project and get animating, I want to take a few minutes and share some of the interesting tips and tricks that I found while ...
I wonder how does that do the Z depth thing
I've been wondering about that but it's not worth 35 usd for me at the moment lol
uses world position offset to squeeze the mesh
squeezes? as in makes it flat but adjusts for perspective so it still looks as if it wasn't?
I only glimpsed at the material functions for a moment but yeah, something along those lines
interesting, might have to try that at some point :) thanks
Found this https://www.youtube.com/watch?v=jpm2RRgCbW4
How to use a custom HLSL script to have complete control over your First-Person field of view. Inspired by Bhaid's excellent Panini Projection script derived from Unreal Tournament. Topics covered: Material graphs, material functions, material parameter collections.
LINKS:
Bh...
Panini projection.. what a name
for when you really want a smushed crispy sandwich?
does anyone know what this node is
i need a refresher on how to get to its settings to change one if its variables
heya, im working on making my game co op multiplayer and im trying to get an animation to play for all players on a specific actor, in this case, when one player opens the chest i want the server to open it for everyone, but im having trouble making it work that way, anybody got any ideas? im trying to do blueprint only
can i simply check, if some object is in my view?
@simple berry I'd recommend a good read on RPCs and Replication and how to use both of them to accomplish things in multiplayer. If you haven't read it yet then read this twice. http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
for example in the finder of a camera?
i need a refresher on how to get to its settings to change one if its variables
@pine trellis it's blueprint interface. Open the interface you made. You will find all the functions you've made inside
Good afternoon, please help.
After hitting my character, he can turn on his side. I can not understand why this can happen.
Not always, but only when I turn the mouse.
the camera remains in place, but the position of the character's body changes.
I dont have any idea
why
@ancient topaz What is ment to happen?
the body of the character turned sideways.
And its not?
it should stand upright.
So wait explain what is ment to happen?
anybody else experiencing startup crashes when using structs?
should stand like this
But after receiving a blow, its angle changes and it stands crooked. Maybe lying on its side at all.
Maybe check when its ment to go back to the standing state?
@ancient topaz We can't help unless we know what you're doing when the character is hit. Just going to get a lot of wild guesses.
@maiden wadi Just playing hit animation
It is working normal before i make 2 thing
AIM
and Change Camera wiew with Arrow
hey, i have an issue with my top down shooter game, can anyone help me?
basically i have the shooting system done, however bcuz the camera is a little bit tilted and not directly above the character, shooting at certain angles is very innacurate
would it be possible to make the character look in the general direction of the crosshair rather than directly where the crosshair is pointing?
the red line is where the linetrace is shooting, and the green dot is where my crosshair is
if i shoot straight forward it works perfectly
but if its at a 45* angle its really off
is the crosshair the mouse cursor or something else?
yeah its the mouse cursor
I think if you do a linetrace from the camera to the cursor's world position that might do it in such a way that you can get the actual point in such a way that the character would point to it more accurately
from the camera?