#blueprint
402296 messages Β· Page 496 of 403
Is there a way to make a mesh "thicker" through its material? Imagine you have a cube and you wish to scale this cube the further the camera is and you wish to do so by changing a material parameter. In my case it's a more complex mesh than a cube (and I can't just set its scale because the mesh is hollow in the middle and If i scale the mesh the hole in the middle gets bigger too)
im working in blueprints right now, making my first game, how can i effect every object that is simulating physics? one of my characters is going to have control of the environment so im trying to set him up to be able to perform an ability that applies force to all physics objects
im working in blueprints right now, making my first game, how can i effect every object that is simulating physics? one of my characters is going to have control of the environment so im trying to set him up to be able to perform an ability that applies force to all physics objects
@neat birch You can get all actors in a radius and then apply the physics to the retrieved actors (you can check if they are simulating physics). If you really want every actor in the scene you can also loop through all actors in the scene and do the same
In order to get actors in a radius you can use SphereOverlapActors. If you want all actors in the scene you can call GetAllActorsOfClass and use Actor as class
In order to check if they simulate physics you can get get all components by class MeshComponent and for each component check if it is simulating physics
how do i make a projectile not "freeze" when it spawns inside the player's collision?
i'd like it to always spawn, but completely ignore the player
i tried "ignore actor when moving" but that still doesnt fix the problem entirely
Guys have a question, is where any way to setup automatic level streaming? because i have random generated map, and cant figure out a way to set up streaming levels
@sharp charm Maybe set up a collision channel for your projectiles that ignore the channel your player uses and vice-versa
@keen goblet oh, this seems like it could work. thank you
I have an Bluprint Actor that i want to delete from the ThirdPersonCharacter bluprint how can i delete the actor?
I know i need to use Destroy actor
@dense ledge I'm by no means an expert on shaders, but maybe World Position Offset could help: https://docs.unrealengine.com/en-US/Resources/ContentExamples/MaterialNodes/1_10/index.html
An overview of the Material Nodes example level, example 1.10: World Position Offset.
@keen goblet your suggestion worked, but now a direct hit from a projectile just passes through other players (i am in multiplayer)
i was thinking of enable overlap instead of just ignore, and making a check to see if the hit actor is not the owner?
unless there's a simpler solution
but then again, that wouldnt generate hit events
@sharp charm My first thought (and maybe this is a horribly unoptimized idea) is code a special case. Have your bullet start out overlapping players, then check when it spawns if it spawned overlapping a player. If not, set it to hit players. If yes, on EndOverlap w/ the player, set it to hit players.
@keen goblet just realised that would be tricky, as the overlap/ignore collision only works when i set it on the player
so that code cant be run on the projectile itself
Hi, does anyone know if it's possible to procedurally generate a montage and add a notify to it?
How to change the default controls? in the bluprints
becuse, i am making a game where the controlls change overtime and the controls are getting displayed on the screen.
How can i make a system that randomly changes the controls?
@hard cloud
https://www.youtube.com/watch?v=Cq2_OwR3DGA
https://www.youtube.com/watch?v=7GItdkVrml0
https://www.youtube.com/watch?v=5pY4rcxmk_Y
In this video I follow tutorial from Longmire Locomotion: https://www.youtube.com/playlist?list=PLAR8Kc1ZLLKZjnKI_idX7Ik7mN0VORSm_ to make this video
Advanced Locomotion System V3: https://www.unrealengine.com/marketplace/en-US/slug/advanced-locomotion-system-v1
RavensS1 char...
In this quick tutorial I will show you how easy to add your character mesh to ALS V4
Did you like what saw? Please support me in my journey https://www.paypal.me/imaginedreams7 or join the project Discord https://discor...
This video is part 1 of a multiple part tutorial on merging Advanced Locomotion System v4 with Character Customizer.
The same method could be used for other custom characters too.
Marketplace Links:
ALSv4 - https://www.unrealengine.com/marketplace/en-US/product/advanced-l...
Hi all, (Multilplayer) would I be correct in storing pawn changes for example skin material/colour on the player selection screen in my GameInstance?
I currently have it setup this way and working but wanted to get a 2nd opinion or more if this is the correct place?
for initial setup sure
but you need store it somewhere where everyone can access as well too
because other players will need to know how that player looks as well
instance is not shared
after game starts
@trim matrix current setup casts to instance to set and get which seems to work but on occasions colour's don't replicate, almost like I need a delay somewhere. Hence asking the question to gain better understanding
dont use instance for replicating properties its not for that
use it to transfer the information between levels
then set it up once player joins in
How to avoid jump trajectory to be interrupted by player movement input? I'm using the top down level, and air control is already set to 0
So playerstate should be my port of call for colour changes on players and other items.
I have all my player names map names and image changes etc already in player state replicated which works fine, I had already added my colour stuff in instance some time ago.. so now time to setup correctly I think (nice flow)
@trim matrix thanks for tip, appreciated π
you`re welcome
Gotta love replicating haha, took me 4 days to fix my loading screens and get in sync hehe
Only 2 hours a night though π
Okay so I am fully prepared to be told this is not possible and so will have to look for another method, I am currently using a for each loop for some data, at present there is around 24 rows of data within the array but there may be more in the future (array is created using using json via the VaRest plugin) I want to be able to take the data produced and update a variable for each row so that I can access this data else where in the project, is this something that is possible or am I as well looking for an alternative?
@small ridge check your construction script, disconnect everything from construction script
I had to waste a whole day with event dispatchers which wouldn't subscribe unless you pull out from the out pin of the casting node and select "bind ..."
I right clicked on node graph to bring up "bind ..." and they wouldn't work
Took me a whole day to figure that one out
oof
I would call an event dispatcher and all of them in that BP would fire
Couldn't figure out why it was so weird
in what situation would you use event dispatchers? I find myself mainly using casts or interfaces...
Ok so lets start with i would like to be able to generate these rooms as i walk into the first room and so on and then i would like them not to overlap when i generate the next set of rooms next to the ones that already have rooms made
i can agree with that one but anything else? :/
i set up the bars once like that, it was fun
when you want information
Hi, any of you guys know how to avoid jump to be interrupted by player movement? Air control is already set to 0
while in air, disable inputs
Hi, I have a Material here and setup Domain to PostProcess. In it is a VectorParameter. I added to my pawn PostProcess and canΒ΄t figure out how to change the color of the Tint of the PostProcess. I canΒ΄t just pull out Set Vector Paramater Value, because it is no Material Dynamic. Is there a way to color tint a PostProcess, like when firing a wepon becomes red or if jumping into water becomes blue?
Something like that?
hm, I would put it on the anim BP
while jumping animation is true, disable input
you'll have to cast to your PC
@hexed saffron look up material parameter collection
So I'm trying to make an interaction system. Here is a general idea of what I'm trying to do. When I pick up an item using a line trace, I check if it has a certain tag and if it does, I check whether I'm pressing a key and then I add the item in my inventory and use the destroy actor node to remove it from my level. The issue I'm running into is that when I have the destroy actor node plugged in to remove the item from my level, after like a minute my entire inventory will reset and go back to being empty. Now this only happens when I destroy the actor that is in the level. I really don't understand why and any help would be great.
I don't see any node for jump or disable input on the animation blueprint. Maybe it's because i'm using the top down level?
@trim matrix When you 'store' the actor, it doesn't create a copy. It just makes a copy of the reference. So when you destroy the actor later, it goes away from everywhere that it was referenced. You'll have to either hide the actor (turn off rendering, collision, tick, etc) and not destroy it. Or the route that I prefer is that you'll need to come up with a way to represent the actor you are storing (probably with a struct) and convert your actor that data before destroying it.
Oh. That is generally what I was wondering. Thanks a lot!
@zealous moth The MaterialParameterCollection seems not the correct solution.
@trim matrix I would do this in the character code, not the animation. Somewhere you handle the jump command. Put the disable input in there. If you are using the character class, you should have an OnLanded event that you can use for enabling the input.
@hexed saffron It should work. Can you explain why it isn't?
@hexed saffron then you're doing it wrong. Make sure you are changing the correct thing.
Also I created a MaterialParameterCollection. VectorParamters, a test color. And put that into the main material right?
yeah in the main material, set up a "parameter" you rename to wahtever you want to modify the value of
and then in your actor BP, you refer to that parameter collection and get the vars
I have this error now.
You are using a vector4 in the parameter, when you are using vector3 in the other nodes.
^ yeah that, make a vector 3 param
Change the param to a vector3 or mask it out.
or mas... dang it
π
Ah mask yeah, that worked. Okay and then call it from Blueprint... Okay IΒ΄ll continue trying it. Thank you man.
np
Never mind my ? fixed the issue with ray cast
Is that how it works?
That's what I was thinking. Does it work?
Shouldn't have much to do with it, as long as control is through the controller.
A less elegant approach is to create a jump boolean. Replace the disable/enable input with setting that boolean. And then in your left click movement code, check if jumping before allowing it to execute.
I say less elegant, but it might actually be more versatile if you want to allow some actions while jumping, but disallow others.
I have a third person multiplayer game im working on. everything actually works great, I can get animations syncing movement seems smooth. but when clients are standing still, the camera seems to jitter a lot. only on client, and only when standing still on 90% of meshes (There is one when standing on it the jittering stops) I cannot figure out why
Sounds like the server and the client don't have an exact sync and are fighting over who's right.
Thats what I was thinking, I just cant figure out how to trace the issue. It showed up out of nowhere. maybe I just suck lol
Nah, networking is just hard.
I don't actually have enough netcode experience with UE4 to help too much here. But there is a #multiplayer channel that might have some more expertise in it.
There was no jittering issue for a while. also when characvters collide they seem to throw eachother around, which it wasnt doing before
snap! I didnt realize I switched to the BP channel either fml
Thanks though
Np. Good Luck.
that is a bit broad
set a different mesh? π
@past girder the best way is to have both skeletal meshes part of a same actor; on trigger, scale one to 0 and the other to 1 and swap controls
Has anyone used the footstep plugin that is free on the market place?
when i swap cameras it stops getting picked up
on overlap, i change the camera using a blend but then the sound stops; the component still plays sounds somewhere but nothing is picking it up
or would anyone know where sound is picked up on?
This is more of something I just wanted to learn rather than something I need help on, but do face normals (when using line traces) change if an object is rotated real time? Or are face normals only a local thing for an object?
Hey, so im looking for some help. Im currently trying to setup an intentional movement delay which is essentially a state the player can be in. Im using a PaperCharacter and using add movement input. The actual moving works but when I add a delay the movement itself becomes slow rather than just being delayed.
This is the movement logic
without a delay behind the movement input
Hi! Could I get some help pretty please
I've been working on this BP for about 9 hours
I want to die and just need a solution :p
@zealous moth Do you have attenuation settings on the sound?
I have two meshes in my blueprint, I want my beam emitter to go between them
@trim matrix Face normals are usually only relevant for rendering. Collision and traces shouldn't use them. They 'might' be relevant when doing a visibility trace, but I don't actually know off hand.
At the moment it's doing this instead of going between them
Any help would be seriously appreciated, I feel so exhausted :/
@lethal night How were you doing the delay before where it ran slow?
I set the delay just before the add movement input @inner ginkgo
and when the delay is there it makes the character move slowly
otherwise its fine
You mean a Delay node?
F
It works in my blueprint viewport but not my level editor 
@inner ginkgo yes
but why would the attenuation change when you swap cameras?
i thought it was the sound itself that drove it
@lethal night Yeah, I don't think that's what's you want. This might actually be a little tricky.
Oh really?
@zealous moth It is distance from the camera based. So, if your camera is further away from the sound, it'll be softer. Or even silent.
nah distance is same
@lethal night Yeah, you'll need to store the inputs and a time they were inputted with the axis value. Then process them after your delay has happened.
If it wasn't for the axis value, you could get away with setting a bunch of timers and process them.
@zealous moth In the sound itself, try changing the virtualization mode to Play when silent. I wonder if the inactive camera isn't picking up the sounds.
@rugged geode You are using world location in your construction script. When looking in the viewport, I have no idea what world location means in that context. But it has a world location when placed in the world.
So interestingly replacing the blueprint in the world updated it and it worked
But when when I simulate, it breaks again
@inner ginkgo nope did not do it
@rugged geode Are the beam settings supposed to be in world space? I would have figured they would be in local space.
You can try replacing all of your get world location nodes with get relative location nodes.
So interestingly placing the exact same thing in both construction script and in the event graph fixed it
UE4 was not updating the beam emitter unless I moved the model manually
Yeah every time I compile I have to move the speeder manually at least a unit
weird
Well at least i'm glad that's 9 hours of wondering over
@inner ginkgo it is not the camera being the issue, it is the overlapping with another actor collider
no clue why
lol
So if you disable the camera swap from that execution, it behaves the same way?
yup, i am working on the collision channels
if i set all to ignore collisions and no query, it works as intended
so a collision somewhere is at fault
Gotcha. That's at least debugging progress. π
k i found it
so the footsteps uses an event overlap trigger
the foot strikes the ground and then the ray trace would do a check
however, when my actor's collider is set to static, like the ground, it would repeatedly try to play a sound
but the actor has no tracks
Is it doing material based sounds? Otherwise, I don't know why it wouldn't just play on an anim notify.
yup iy is using both materials and anim notify
Gotcha.
the anim notify calls the ray trace, the ray trace checks what you're standing on and what material it has and then plays the appropriate sound
Hello everyone, I have a 'Gun' class that has an array of 'Starting Attachments' (attachments that the gun will spawn with), how would I alter that array before the gun is spawned into the game?
the easiest i can think of is to do it on beginplay (or even construct) and when you spawn it, cast into it and set the values before rendering the mesh
hah take that eckish
@quasi relic You can edit the default values in the editor, but that will be for all of them. If you want to change it at runtime, set it public and expose on spawn. Then the array will be there on the spawn actor node.
@inner ginkgo ok thanks!
Np (Take that back Zanet)
@zealous moth thank you also! sorry, i didn't see your message!
unforgiveable
How intensive is the Get Data Table Row node? I have some UI elements that use different values for the same stats, but instead of making a bunch of copies, id rather just use a data table and pull info. Does it use a lot of resources or not so much?
I haven't actually measured it, but I use them a LOT and have not had any issues.
ok that's good. I won't be using them too much, and only on creation of the widgets so shouldn't have to it it too many times
thanks
Guys how I could make the draw of cicle In My minimap widget
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Hi everyone, Can someone please tell me how or a workaround on avoiding world composition streaming hitches
@trim matrix Face normals are usually only relevant for rendering. Collision and traces shouldn't use them. They 'might' be relevant when doing a visibility trace, but I don't actually know off hand.
@inner ginkgo So if you wanted to get the direction a face is pointing how would you go about that? (Not using a trace of some sort to grab the normal)
Are you talking about a material or outside of materials? Outside of materials, I'm not sure without getting the mesh data.
On blueprints to get the vector of where a face is facing. :p
In code in game engines and 3d modelling software, normals are calculated using Cross Product. There is a Cross Product node in blueprint. That is the extent of my knowledge on that. I saw it on google trying to figure out spherical gravity
You can convert a static mesh to a procedural mesh. And from there, get the mesh data. You'll have to apply your own transforms, too. Then you can calculate the normals of any face you want. What is the use-case? Why don't you want to use a trace?
I would be fine with using trace but your message seemed to say that it was impractical to use a trace
Specifically for changing gravity based on the vector of a face.
What 'face' are we talking about.
Let me get an example just a sec :)
is it possible to rotate a socket while i am spawning a projectile from it?
i need to account for slopes
Do you mean rotate it before spawning the projectile? Or as a result of it?
A perfect example is from a game called Marble It Up. Surfaces that have a gravity material change the gravity to be down based on how the gravity surface is facing (when your marble rolls up the surface) so gravity has a smooth transition. @inner ginkgo
@inner ginkgo before
@trim matrix You can do a trace on complex and it'll get you the normal of the impact. Which in this case should be the same as the normal of the face. But that's probably not the solution to this problem, because you still need to decide to trace that direction to begin with.
@robust cliff Then yes. You should be able to rotate it before and it'll pick up the changes right away.
Get Unit Direction Vector is how i calculated spherical noise on my planet, this is a demonstration, may help?
Anyone know how to World Origin Rebase an object that wont World Origin Rebase. It is the new Sky Atmosphere. It will Rebase in 4.26 but im impatient. Im sure it has to do with linear algebra and my location and the starting location of the Sky Atmosphere actor but i just cant quite get it. Its the rebasing math that Unreal uses but im just not quite that smart to get it.
Are you doing it in the engine code?
No, all blueprint. Im moving it around but its slightly off all the time, im 80% there, my math is just wrong
It should just be current location + current offset - new offset. But there would likely be a hitch, since rebasing doesn't happen immediately.
Ill give that a shot, thx
@inner ginkgo do you have any code examples for this?
Not offhand.
Something about this logic is not right: the variable is not being stored or transferred correctly. When I try to print the displayname of the actor class it simply comes up null.
-> Storing a selected actor's class in the player's GameInstance
-> When a player enters the game, the PlayerState on BeginPlay gets that variable and creates a new variable inside the PlayerState mirroring it.
-> The GameMode then attempts to spawn the actor when an OnPostLogin event occurs, using the PlayerController's PlayerState to get the actor class variable
The variable in the GameInstance should still be set at that point. Have you verified if that one is showing a value? That will help determine where the failure is.
hrm ok, so the playerstate is storing it successfully but in the onpostlogin it is not getting the variable
@old bobcat So, I wasn't sure on the timing there, so I just ran a quick test. PostLogin fires before the PlayerState BeginPlay. You'll need to think of a different way to coordinate that handoff. It might be best to just look it up directly from your GameInstance var.
ah that would do it, thanks
If I have an array of structs, and a boolean within each struct, is there a quick way to count how many of the array items are True and how many are False? Or am I looking at needing a ForEach with Break?
As is, a foreach without a break.
But you could keep an active count as you add them to the array and then just use that.
I have a semi-operational item finding system. right now if an item is found on the field, the Lead character gets it, or it stays if his bag is full.
I want it so that if the Leader's inventory is full, the item goes to the next character, and so on until there's a character with an empty slot, or if everyone's full up, the item stays on the field.
Thus: I was looking to set up a For Each with a Break to get the Index of the character with the next available item slot.
I have it set up as a big intricate "Things within Things" matrix.
Gotcha, I was focused on the count part. A foreach with a break would be a fine solution, then.
Ya for counting it would be no break. I asked about counting to see if any quick way was possible
My Setup goes
Team: Array of PLayable Character Structs
Playable Character Structs have several variables including Inventory
Inventory is an Array of Item Slot Structs
And the Item Slot Structs have a Boolean for Full vs Open
so yea, it's a lot of 'Things within Things'
is there any way to get a player controller's game instance from inside the gamemode?
There's only ever one game instance. So the one you get from game mode is the same in the player controller.
What's wrong with just running them through a simple function that takes an array and returns an integer that loops through the array and adds one to the returned integer every time a true is found?
Please suggest some tips on how to use curves to move object with BP
I've got items passing to the next character when bags are full!
So I've got a Child Widget that shows a character's name and acts as a button. Right now all it does is print a string that Confirm it was pressed. Both my Items Menu and Status Menu have these 'Character Line Buttons' on them; the setup adds one of these buttons for each character currently on the team.
My question is: If I want the button to go into Item Inventory when pressed on the Items Menu, or Full Character Stats when pressed on the Status Menu, will I need to Duplicate the widget and make sure each menu calls for its own customized Child Widget Buttons, or is there a node that can detect which menu is currently active and allow me to direct it to the correct function accordingly? Or perhaps I can cast 'Current Menu' to the Game Instance each time the Menu changes and have it check that to see which sub-menu to summon?
Anyone have an idea why my overlap event on my projectile is dealing more damage than the amount I have set in the variable?
Can I access the items in a Group Actor through Blueprints?
i am using the third person default setup and when standing still and looking at the character from the front side i want the character to turn when i click/fire my weapon how would i do this
hi ! b
i dont know how to make character with animations and stuff
i am willing to learn blender
and i am willing to learn all u need to make your own ai base, i only dont know how
if u can make animations made on my own character my game is complete
i would like to ask for liiiiitle help . please π
@trim matrix if you are starting check out mixamo.com
Is there a way to get convert a key to a string? There is the "GetKeyDisplayName" node, but this returns a full length name of the key. For example instead of "&" it returns "Ampersand". How can I get "&" instead?
It's for displaying keybinds in an actionbar, and "Ampersand" isn't exactly short π
Why would I be able to use AI Move To in my event graph but not in a function in the same pawn?
I had wanted to pull something out into a function but it appears I cant do that
unreal has some oddities
anything like a task or to do with time can't go inside a function
you'll have to make it an event
gotcha, np just was curious
Can somebody please expain
how the "OnClick" thing functions
I have a BP that has a bunch of cameras, and collision boxes
the idea is the player interacts with it. Moving the camera over to the Blueprints viewport
and then the player clicks around for collisions inside that which in turns moves the camera around
When I was testing, I realized that the OnClick doesn't function at all inside that BP. However it functions on objects besides it
Having these lined up like this.If you interact with the bed on the left. No OnClick call inside that Bed BP will fire
HOWEVER, if you click on any other bed that you're currently not zoomed INTO, the OnClick fires fine
@trim matrix what does your graph setup look like
please suggest how to use curves in BP to move objects ?
For changing the camera
are the collision settings for the head hitbox set to allow for clicks
I'm changing a few things around. As a collider is sometimes in the way
so I want the skeletal mesh to be able to receive hits from this
how would I go about storing a 'selected character' actor class variable for use in a dedicated server? essentially I have a characterselectmap/hud that is followd by the matchmaking and subsequent entering of the multiplayer map/session.
I'm just trying to figure out how to actually store the actor class variable so I can spawn the player's character into the game. Right now I'm storing it in the gameinstance but I have no idea how to get the server to read a player's GameInstance. I also tried the PlayeState and PlayerController but the event BeginPlays of those fire after the OnPostLogin event, so the variable is not instantiated yet.
can't seem to wrap my head around it, might have to make the character select inside of the actual game or something
fixed: made an event in playerstate that gets called during the onpostlogin that instantiates the selected character variable yahoo
And this does not seem to actually be able to recieve the trace call
Could this be done any better?
https://gyazo.com/0d82c0d85e206ad998d96aba6625c33f
I can't tell what's going on lol
There's lots of ways to consolidate repetitive nodes... Functions, macros, loops, select nodes...
It works though. But I was wondering if it could be done any other ways lol
But I don't understand your signalflow from the screenshot cuz there's a ton of crisscrossing stuff
So idk what to suggest
Based on horse movements, I decide which sound to play and also I reset the other do once.
So if horse is walking I need to reset the other nodes so that when done walking it could run or do other movements
It seems like the thing that's actually different in each "line" is the sound cue
So you could have one line, and a Select node connected to the sound cue input
And then that node selects the appropriate cue based on some value (int, enum, bool, etc)
I have do once which needs to be there as well
Because the movements are active. When I press W, the horse is walking. So that's why i used do once
It's running on tick or something?
Am I correct in assuming the problem the gate solves is preventing the game from playing the exact same sound cue multiple times?
yea
You could do something like... Check if a certain sound is already playing before spawning a new sound. You're spawning a sound cue and saving a reference. I don't have UE4 open rn, but I imagine there's a way to get the currently playing sound cue from your Horse Footstep Sound variable.
You basically do a check that's like...
The sound I want to play == The sound currently playing
If they match, then abort
(or use a does-not-equal comparison if that's easier to read. If it's true that they don't match, then spawn the new sound)
But yeah if you find yourself making repetitive lines of execution in BP, there's always some way to consolidate it.
Put the character's location into destination
i did it but isnt working
yes, i forget it
@lilac lance Mixamo isnt that good xD know that already and hate it xD
How do you delete an extra input to an audio Random node? I want to get rid of that last one: https://i.imgur.com/XZAs4Ye.png
Rightclick -> Delete
Dang, thought I tried that. I must have clicked off the input. Thanks!
Quick child/parent question. I want to be able to change a couple montages per child. I'm not sure how though. Would I have a few exit pins from the parent, if so, then how? Or can I make these montages variables some how?
HAHA! I think I just answered my question. Would making them variables be the right way to go?
I'm happy with good enough π
instead of casting to each individual actor on trace from my character to have interaction whats the most efficient method?
@dreamy ice wdym casting to each individual actor
previously I would cast my hit object to my "basedoor" or "baseitem" actors and if one failed I cast to the next and so on until I either got a hit or ran out of things to cast to.
You can use either composition or inheritance
On hit you can check whether the hit actor has a InteractionComponent for example and then have your interaction functionality implemented there
Hey Guys,
im searching for a solution/tutorial how to control a Unreal Scene via html website hosted in network. Any ideas where to find?
That sounds like the solution I was looking for thanks. π
Or you could have all the things you want to be able to interact with inherit from a base interactable class (which is bad lol)
@sturdy crane you won't find something this specific
Hello, how do i repeat a float between 0 and 1 if the input value exeeds this , so that 2.5 would only be 0.5
Just get the decimal part? I think there was a function for that
@autumn heath okay sadly. Any idea where to get something programmed like this?
You could ask around I suppose
@mental cliff you can do something like that:
- Floor the float
- Substract your floored float from your current float
So if you have:
float1 = 2.5
float2 = floor(float1) // in this case that is float2 will be equal to 2
float3 = float1 - float2
and here float3 will be your float that only goes from 0 to 1
@autumn heath Thank you
floor should be a function available in blueprint
Perhaps there is also a function in blueprint that return only the decimal part of the float, you might wanna check that
I havenΒ΄t found this decimal function but perhaps must have overlooked it everytime
Weird question, anyone know if you can put a "Target Point" on a blueprint class /player?
You can spawn a target point and attach it to the player
Perhaps just use the player's location
@arctic rune
@autumn heath @mental cliff
float_one = 2.123
float_two = float_one % 1
Whaaat
% being modulo operation
Didn't know the modulo did that for floats
UE4s math library has fmod, so pretty sure blueprints have that too
Well that is a nicer solution
@autumn heath Hate to keep asking questions, but how would you attatch it to the player? I know you can add constraints to the Target, but that is just a Z-X-Y thig?
If TargetPoint is an actor, you could just add a ChildActorComponent with it
You can also attachactortoactor
Ill give it a go, thanks
@surreal peak thank you. Now i just need to check if the output is divisible by 4 and if so the output is true
That's easy
Cast to int, however idk why you are checking if a float is divisible by a number, perhaps it's something else
guys who can help me?
ok wait me a moment
I want to know how to put the circle and paint it on the minimap
put it there
my cicle is drawn in my big map but in my mini map no
@sturdy crane you need to setup pixel streaming:
->https://www.youtube.com/watch?v=9V6Iy-OSlc4
->https://www.youtube.com/watch?v=Qh2-x68Of7I
->https://docs.unrealengine.com/en-US/Platforms/PixelStreaming/index.html
Learn how to setup pixel streaming for remote connection.
With the Unreal Engine 4.24 version, Epic Games changed a bit how Pixel Streaming works, embedding Web RTC directly into the plugin and simplifying the setup process.
In this video, we are going through the setup proces...
Unreal Engine 4.21 has added the ability to run a packaged Unreal Engine application on a desktop PC in the cloud, and stream the viewport directly to any modern web browser on any platform! Get the highest-quality rendering in lightweight apps, even on mobile devices, with ze...
Run your Unreal Engine application on a server in the cloud, and stream its rendered frames and audio to browsers and mobile devices over WebRTC.
So there was a guide after all
@hard charm seems like your minimap is too zoomed in
my minimap is map with zoom
lol
It is made with a material
Okay real basic question here, if I just want the enemy to move to the player, whats the best blueprint class to use? Would it be Character? - Dont really want to use a behaviour tree as I just want something really basic to test ideas
yes i have texture of my map since up
@arctic rune I mean you could use just a pawn
@spring cosmos ->https://www.youtube.com/watch?v=JWN7ljhAOMM
->https://www.youtube.com/watch?v=NOG0RsuqRUg
A quick dive into how to cast objects in BluePrints!
If you have a good idea for a Quick! How To video or have a question about UE4 let me know in the comments. If I can answer it quickly I'll try to make a video response!
If this was helpful and you want to see more subscr...
This is a part of the seasons requested tutorials. ________________________________________________________
Like my content or found it helpful!
Subscribe for more!
Support me on Patreon - https://www.patreon.com/Realtime3D
Paypal - https://www.paypal.me/NowYoshi
Visit - h...
Ok ty
@gritty elm to advanced. i really just need a UI Interface (html) on a ipad to change states of materials and so on....
@hard charm https://unrealpossibilities.blogspot.com/2016/01/unreal-engine-tutorial-create-circular.html
I'm trying to get this box to attach to my back, kinda like a backpack, but I can't seem to do it. What am I doing wrong?
Looks attached to me! If you mean it isn't following his back, then double check that the socket you named is correct. Sockets are different from bones. You would probably have to create one.
^
It's requesting a socket name but you are giving it a bone name
Since there is no socket with this name, it just doesn't attach it to that socket
@pine idol
I have a little issue here.
How do I simulate controller pressing for VR
Like for example in the blueprint, I can make something that does "If Key X is pressed, then do this"
How do I do that for a VR Controller because I can't find that in the blueprints
@ me if you answer
@bold isle set up in the input section
Set an action for a specific vr controller press
Where's the input section ?
In the project settings -> input
Thank you so much
Okay this might be hard to explain, and since I dont think I can upload videos here this might be hard to understand. I have an enemy, thats entire purpose is to run at the player. It does this fine as long as its on a navmesh. If the player leaves the nav mesh it will run at them and stop at the end of the nav. When the player re-enters the nav mesh, it does not keep following.
TLDR - It follows me out of the Nav mesh, then cant move to get back into it xD
How are you handling the move code?
It's because you are only calling this on BeginPlay
When he exits the nav mesh your execution chain is broken
Moving it to tick would fix this wouldnt it? Or would that create some issues further down the line
And you shouldn't write code like this
@gritty elm thanks this is really helpful
He has it setup recursively, which isn't great, but works. But if the pawn is actually leaving the navmesh, then yeah, it won't get back in.
Moving it to tick would probably crash
Yeah the worst part is the pawn actually leaves the nav mesh to follow xD
Should I just add a loop after the begin play?
You should really use a behavior tree for that
You need to get the pawn back in the mesh. Or prevent it from leaving.
You could create invisible collisions that only react with the pawn's channels. That would keep him in the play area.
But they may stop moving as soon as you cross the barrier, rather than going up to the edge.
Well tbh, in terms of the "game" im trying to create there shouldnt be any areas the enemy cant get too, so I could just fill the entire map in a Nav Mesh. But that feels like a really bad habit to get into xD
If the map is small it's ok
Yeah plan is just a couple small arenas where enemies spawn, run at you, and you shoot them xD
You need a navmesh in every spot you want AI moves to work. If you want to avoid large navmeshes, you'd have to go the route of writing your own move code.
Because of perf. π
There's a bunch of settings in project settings for configuring how your navmeshes work.
You'll need to tighten a few things to get the coverage you want.
Ahh okay, what is perf? If you dont mind me asking xD
Performance
They could build the best navmesh possible with tons of coverage, but it would consume a lot of memory and more CPU time.
As far as taking damage from a projectile should i use onOVerlap or Onhit???
Ahh okay, Is it Project settings? Trying to find how to edit this xD
Yes, Project Settings -> Navigation Mesh
Depends on your design, @robust cliff. Either is valid.
Oh, there is a ALOT of options any guides that would help here? Little bit overwhelming as to what to change to fix this
@inner ginkgo Right now I have it set on overlap but I notice that when I am closer to the projectile that it deals more than the damage amount I am setting the float variable to, any thoughts?
@arctic rune I haven't tweaked them in a while, but I remember a few coming up with google searches when I was messing with mine.
I would imagine slope and step height are the ones that will resolve the issue you screenshotted.
Turns out they still walk there so its not a big issue. Just need to the NavMesh to actually go to the edge of each Mesh in the level
As for now If I move to close to the edge they just break xD
@robust cliff Throw some print strings in your damage handling. You might be getting multiple overlaps on a single actor. It'll register an overlap with each component.
cool thanks
@inner ginkgo @autumn heath same problem, unfortunately.
So you made the socket?
Checked if the name is correct?
mhmm
Hmm, change the collision settings when spawning the thing to ignore collision
the collision is off completely, other than visibility
set to overlap for everything else
What does it look like attached? Does it track anything?
Hmm can you send the code again
it depends on the rotation rule I use.
so should I just say snap, and the manually set the rotation, or does that not work?
Try to set location to keep world
Keep world is the only thing that's close.
Depends on the problem. If it is tracking, but in the wrong place, then relative position is the issue. If it is tracking the wrong thing, that's a diff issue.
Btw you are not attaching it
In the target you need to put a reference to the actor
ahh, so i have them reversed?
The default of self should work assuming this is in the backpack actor.
But you can plug self in there to be more explicit about it.
Hmmm
Well you do have a branch there. Verify that code is getting executed.
yup! it goes through succesfully
pickup just makes sure no one else can take it from someone who already possesses it.
Still, try to take the pin out of the set node and put it to target
I still need to ask. Is it tracking with the animation, just in the wrong place? Or is it not tracking at all?
Then it is your relative location.
I thought it didn't move at all
So the attach is working, you just need to get the position.
Yeah
When spawning the actor
Take the socket transform and put it in the transform pin
i think the position and socket are correct, because the backpack moves with the animation
You need to position it after the attach. I would personally choose snap to target, then do an update on the relative transform.
Hi! So im new in Unreal and I have a question. I have a Character BP, where it is the movement. Now I want to add it health / weapons etc. Where would I add it? If it were Unity all the health system would be another script, same with weapons. Can I add another BP? Or which would be the workflow? Thx
Components probably
Actor components?
Yes
@trim matrix You would probably want to make a weapon another Actor, but I'd put health in a health component.
Health can also be a variable on the Character, depends on how robust you need your system to be. If anything besides a Character needs to have health, make a health component.
Same result @inner ginkgo k
@trim matrix actor components are the base, scene components have a location, rotation, and scale inside the actor, and primitive components are scene components that are renderable
Ok, thx guys
@pine idol What was your transform like? I wouldn't expect it to be right on the first go.
@pine idol set up your sockets such that you can snap the attached actor to the socket, and it lines up.
how do you guys clean up your materials?? I mean i'm just looking for clean blueprint reference
@trim matrix What do you mean by clean up?
cleaning up noodles
I just make them not spaghet to begin with. Lol
How many materials do you have? You really shouldn't have tons of master materials, just like one per material type and then parametric instances of them
Hey guys, I was wondering if there's a node in the material blueprint system that could be used similarly to the texture sampler but instead of a texture, it would reference a material instance to be used inside the graph? If that makes sense?
You can use material functions to help isolate some portions of the code.
i mean is theere any secret stuff or i just have to accept the spaghetti
If your spaghetti has repeated things, make material functions
okssss
@faint pasture yes, i'm currently using sockets, but no dice still
What does your relative transform code look like?
I just deleted it, but it was grabbing the position and rotation of the socket in question, then using those values for the backpack to set the transform
It won't be an automatic thing. This is an asset prep thing.
Looking at the box attached, it is attaching the center of the box with the forward coming out of the side.
so i need to manually place the box, get the offsets, and use that for the transform?
You'll need to do a 90 degree rotation and some translation.
ahhh, ok
You can modify the box actor to have the right offsets. Or move the socket. Or do the relative transform change after attaching. All would work equally if you no future use-cases for this attach point.
yeah, i moved the socket in the right position
just gotta figure out how to get the socket rotation to apply correction.
correctly*
If you changed it in the editor, snap to target should pick it up on the attachment.
Looks rotated to me. I think you just did the wrong 90 degrees.
What does your socket look like?
The details π
So you do have a slight rotation. But that's where you'd correct it. Need to get the correct rotation there.
yeah, that's just to correct for the curvature of the spine.
i'm just not sure, when it's snapping, why it's rotating so badly like that
so i'll try here then
yup. that did it.
thanks!
still, very odd to me that that happens. lol
The socket is attached to a bone. The bone picks up rotation from the hierarchy. So you need to likely correct for any rotations the bones collectively had.
yeah, but it's the default UE4 project. i started this last night, so I doubt there's an issue there. haha
well, thanks again for the help. π
Np
Yeah. But for the confusion you have, the default bones have a lot of rotation. Like click on the pelvis.
90 degree across the board.
Each of the spines picks that up and adds its own.
dafuq... lol
welp, good to know!
probably saved me a lot of headache down the road. lol
Yup. Lots of manual tweaking when doing attaches.
well, that was the easy part of this project, onto the hard stuff. haha
Haha, good luck.
thanks, imma need it
trying to make a UI-less inventory. look in the bag sorta thing.
no idea HOW i'm going to do this. haha
Hey all, so my understanding is Event Tick = Bad if there is a way not to use it. (oversimplifying here, but anyway...)
Question regarding this... My project is essentially a city builder in terms of gameplay mechanics, and part of that is a constant ticking clock for time of day / passing time. I'm wondering whether driving my calendar (counting up minutes/hours/days to form seasons/years) is best to use the Event tick as it persists the life of the game, rather than using a Timer?
The other thing that I need to mention is that you can increase the speed that time passes in the game by x2/x4/x8, and I'm wondering how that interacts with Event Tick? I guess the increase would need to be applied separately for the clock, as changing the game speed won't impact the tick rate?
(I have it running on Event Tick right now, but questioning this decision)
The Tick disdain is targeted at new developers that tend to use Tick as a first choice solution rather than a last choice solution. If you have something that truly needs to run every frame, there's nothing wrong with putting it in Tick.
Thanks Eckish, yeah I'm aware of the target for newer developers with that advice, more just double-checking my logic here to see if anyone else feels this is wrong usage (still new-ish to blueprints, more of an art guy π )
For your timer, I imagine it is going to be run in a single actor instance for the whole game and it'll just accumulate time. That's pretty low impact. You could avoid it by saving Now to a variable on game start and then comparing Now to the saved value when you want to check the time. But handling time dilation would be tricky with that method.
Yeah I did think of that approach before but came to the same conclusion. My main concern going forward is I'm planning to run timer-driven events, which can occur during a range of time (perhaps, randomly triggered in Summer, for example), and I'm concerned about the amount of checks occurring for a catalogue of events every X seconds might get a bit overwhelming. I suppose it's an issue regardless of using tick or not though
I'll stick with my current implementation for now, anyway π - Events is a problem for another day
@indigo bough Tick is fine for updating Time.
@pine idol In the actor, on pickup attach to socket. Add a variable for offsetting the mesh (to change X value of mesh move the bag forward/backward depending on mesh) and a variable for the mesh itself. I'd also suggest putting the code to hide/show the interact text in here (parent).
I think the socket should be attached to spine_02. Add the inverses of the relative rotation to the spine_01 to your new socket rotation. And set the location where ever. Try to fix the socket on the character to be 180 degrees from character mesh at desired Z and X, and 0 on the Y for the socket (middle of back).
Though after you have done that create a child blueprints for say bag types, then create child classes of that.
ParentBag (offset var, mesh var, make those two instance editable (for use with Backpack1/2, etc), and then an inventory array var/add all relevant vars you need to create the inventory system which will be done inside this blueprint, size/etc, all relevant animations (pick animation/drop animation var, instance editable)
ChildParentBagTypeBackpack (set pickup/drop animation on type specific if they have different animations/rigs)
Backpack1, Backpack2, etc. (set offest var, mesh var in these blueprints here)
After animation plays, attach to socket.
Only a suggestion for improvement, but don't need to.
@indigo bough What you don't want to do is run some crazy logic every tick. If you had every agent evaulating its behavior every tick you'd have some serious problems. In your use case, I'd have Tick update Time, and every time that Time hits a certain value (Every second or whatever), have some subset of the agents do their logic.
Hi I have a question about animation blueprints, I have 2 animations and a boolean that switches between them, basically I want a simple AI where this boolean goes on/off periodically using a timeline, how do I do this? I'm assuming I need to have the anim blueprint as a subclass of the class I use for my AI but do I need to make my AI of 'character' class to do this?
@trim matrix The Boolean lives in the AnimBP on the logic side, and is used to blend between the 2 animations on the anim graph side. You could also have the boolean drive a state machine if that better fits. The boolead can be changed in the AnimBP or from outside by the BP for the Character or whatever.
@indigo bough For random events in Summer, I'd have Time update on tick, then whenever Time crosses a day, run the random event logic.
@faint pasture Thanks! Yeah currently the Tick just adds +1 to my minutes (which resets at 59, adding +1 to hours, etc.)
Don't do that, it'll make time framerate dependent
In your case, just have a looping timer at 1s that adds 1 to the time variable minute
so if someone plays at 30 fps it doesnt go half speed and double speed at 120 fps
Right, of course π
So looping Timer adds to my 'calendar', and then events can just check each day if it's within the required date range, if so +X% to the event's chance of occuring until it triggers.
I think the approach would be that the calendar has an array of possible events, and selects the event for the day.
If your events are setup as data, just have a struct with a date range, chance of happening, etc. So BlockParty might have the range June 1st to August 31st, and a 10% chance of happening. The Calender logic (In Gamemode I'd guess) takes the current date, checks its array of events, finds those that have the right date ranges, then for each one rolls the chance.
The event struct might then have some data representing what to do when the event fires like spawn a special actor or whatever.
Yeah they're set up as data.
Awesome, really appreciate the help! Solo dev is hard π
Does anyone know how I could go about implementing a restart feature? For a specific reason, I need the game to close and reopen.
Restarting the level isn't enough? Or do you need the application to actually restart?
@inner ginkgo The application needs to fully close. Modern warfare requires something similar. It's required when players are downloading data in realtime, like an update.
Gotcha. I can't think of a way to get that done in blueprints. Might have better luck on the C++ side.
Hi guys! So let's say I have a running train. I want to play a train sound cue and I want that to be with the train. So If I jump out of the train the sound should go with the train. Is that possible?
I tried Spawn audio at location but no luck
Yes. You can use PlaySoundAttached.
Make sure you setup some attenuation on it or it won't actually fade into the distance.
Hi. I've got a casting problem. I've got a parent CharBP and a parent AnimBP. I'm making a child of each. In the parents the CharBP would cast to the AnimBP changing a variable. Now in the children I want them to cast to each other and I'm not sure how to change the casting nodes. I'm literally setting two variables in the AnimBP to drive animation.
I may be thinking about this wrong so I would really appreciate being pointed in the right direction π
@inner ginkgo Ok I'm trying now. If I want to stop the audio do I leave the scene input blank?
Sorry, just looked. The node is SpawnSoundAttached. And you get a return value from that. Store that return value somewhere and you can use it to stop the sound.
I added attenuation to my cue. I kept everything default unless I have to change some settings?
Defaults are probably fine.
Just need to select the cue and then the component to attach it too.
@crystal mural Which part of your cast isn't working?
It is working. But it's casting to the parent class.
I'm not sure I'm explaining myself properly.
Which is why I think I'm doing this wrong! HAHA!
So I see a cast to EnemyAnim_BP. Is that one of the child classes? Which is the parent? AnimBP?
This screenshot is in the EnemyChar_BP, casting to the EnemyAnim_BP, which are both parents.
I make a child of the EnemyChar_BP. Call it a ghost... And make a child of the Anim_BP. I make the EnemyChar_Ghost_BP use the Ghost_Anim_BP... but now I don't think they'll talk to each other.
As long as the instances are actually of that type, you can cast to them. But you have to tell the editor to do it. So you would need a cast to ghost.
So how do I cast to GhostAnimBP from the GhostCharBP?
But if you don't need to change anything in the child class, just parent variables, then casting to the parent is also viable.
The same way you did it in the screenshot. Get the anim instance, but instead cast it to GhostAnimBP.
If you mean take a GhostCharBP an cast it to GhostAnimBP, then that's not how casting works.
Ah OK, now here I'm lost. Let me show you quick...
This, I'm sure you know, is all that's inside the child.
I'm not sure where I would change what it's casting to. Or how to make the cast a variable.
Thanks for helping, I'm sure I'm thinking about this wrong.
You don't. If you are trying to change the behavior of the parent class, that's not the right approach.
You have that call to the parent function in your child class. If you want to add more stuff, you keep that call and then add your child logic in the child class. If you want to replace the parent logic with only child logic, then you delete the call to the parent function and again add the logic in the child class.
OK, then maybe my whole approach is wrong.
If you want to only replace some parts of the parent logic, put them in separate functions and then do overrides on only the functions that you want changed.
That's right, I only want to replace this casting part.
Just curious, but what are you changing about the variable setup in the child class?
Child class would be the skeleton, health, points, montages, and on the mesh I change the AnimBP.
And the reason I'm changing the AnimBP is because the characters have unique animations.
But not unique behaviours.
Let me rephrase. What do you think casting to the child class gains you over the parent class in this logic? What does that code look like when you get the cast correct?
why not have just the one class?
change the skeleton and anim bp
based on what they chose?
AnimInstance doesn't care what the base is to play montages
nor should you ever ever need to cast to your animbp
nor should you ever ever need to cast to your animbp
@worthy frost Ah you see. I'm doing this. Should it rather be that the AnimBP checks the Character for variable changes?
animbp should only pull stuff
you should never be setting stuff externally to it
i see a lot of bad practices where people are setting the animbp stuff from there character
that is wrong
Let me rephrase. What do you think casting to the child class gains you over the parent class in this logic? What does that code look like when you get the cast correct?
@inner ginkgo This would be because the child animBP has the animations of the related child character in it.
It would already have those, if you created a child instance.
so you can have 10 child classes
doesnt matter what anim instance is selected
cause you never need to access it.
Keep in mind that casting doesn't change the actual variable. You have to create a Ghost to begin with and it will come with all of the ghost stuff.
so : GhostA is your parent, Ghost B is your child, Ghost A uses GhostA_AnimBP, Ghost B uses GhostB_AnimBP
It would already have those, if you created a child instance.
@inner ginkgo Yes, and then what happens when I make a zombie? I would make another child of the original parent and then another child of the animBP, replace everything because the animations are different correct? Or is that wrong?
you play a montage, you just do, SkeletalMesh->AnimInstance->PlayMontage
you don't care that the type of anim bp is
Ja the montages aren't a problem.
so what is the problem?
your animbp on its update, will cast to its respective character via TryGetPawn and casting to the correct BP of that character, and pulling the stuff it needs.
i really don't see what the issue is here?
I think the problem is that both the animBP and the CharBP are children. I can't change who they're casting to.
why do you need to change
its called polymorphism
honestly just stop and think about the problem
and explain it fully in detail
cause i really think you are confusing yourself and trying to over complicate things
Your parent class has a mesh. Doesn't matter what is assigned. Create a ghost child and change the assigned mesh to ghost and it'll always spawn with a ghost mesh. Create a zombie child and change the mesh to use a zombie mesh and all Zombies will look like zombies. You won't actually need to do any code changes to make that happen. The same logic will apply to all of your animations and such. Get the components in the parent, then set the data in the child and you won't have to worry about casting.
Alternatively, you could go full data based approach and just have one class, but that's a bit more advanced.
cause i really think you are confusing yourself and trying to over complicate things
@worthy frost HAHA! I'm trying the opposite. But like I said I'm probably thinking about this wrong.
you really are
i mean its really quite simple
i always have a BaseCharacter
this character is shared by AI and Players
this has shared logic between AI and Player
then Player has player specific logic, its own skeletal mesh, etc. Same as AI, AI has around 20 different versions of AI
but they all start from BaseCharacter.
Cool, 100% with you there.
and my AI characters/Player doesn't care what anim instance is selected either
as the anim instances pulls from the character, so only it cares.
@minor stream #multiplayer
So then what does the cast look like in the parent animBP? Or would I only do that in the child BP?
Anyone know what I can cast that enemy_bp to ?
in the child @crystal mural
Ah.
@arctic rune reference to your player?
@arctic rune You will want to already have a reference to the enemy_bp. Add a var to the widget and set it to expose on spawn. When you create the widget, pass a reference in.
or enemy
Then that's probably my issue, I'm casting in the parent and no the child.
Cool, I'll rework. Thanks for all the assistance!!
I wrongly assumed that I could just reassign a casting node in a child.
@inner ginkgo What variable type for that?
Enemy_BP π
@inner ginkgo Well I definitely didnt do that right xD
Nope, I don't see it in your var list.
You won't need that cast when we are done here.
Make sure you add it as a variable and not a local variable.
Okay yeah I did that and have a reference to it in the Widget. But it still is not updating the Bar %
Here's in the child. This correct now yeah? Pity they broke the Anim Graph Overrides this version.
yes
You also need to pass it in when you create the widget. Can you show the widget creation code?
Its a component on the enemy
@arctic rune what you need to do
grab the component
get the User Widget Object
cast it to your widget
and set a reference to the enemy
on beginplay
User Widget Object?
yes
It's a node if you drag off the component node.
drop you component reference into the graph
drag of it, type User Widget Object
cast that to Enemy Widget
then set the enemy reference
Yeah got that, not sure what you mean by then set the enemy reference
So I do all this in the enemy_bp Blueprint?
Im ngl mate, im lost
I have an enemyreference in my widget
Not to toss more confusion in there, but to go this route, you also need a delay 0 in front the cast. The user widget isn't set in the first frame.
it is
So do I set the User Widget Object as the enemy reference?
Wtf do I set as the enemy reference then. I dont understand what this is doing...
You pass self in.
Yeah Ive done that.
now in your widget
that ref points to your character
and can get anything it needs
including health
Its still not changing anything on the progress bar, and I still get a bunch of errors xD
What are the errors?
Show your percent binding again, please?
Has anyone seen or used pointclouds(not lidar) https://docs.unrealengine.com/en-US/BlueprintAPI/PointCloud/index.html
Point Cloud
and also show your completed begin play on the enemy ai bp
You missed a wire.
Happens. Especially when you've been staring at the graph for a while.
True. Thanks for the help anyway
So it is working now?
Yeah :@D
Awesome. I guess I need to recheck some of my own code. I've always had issues with user widgets in begin play.
Seems super simple to you guys, but considering I'm new to this Im kinda happy xD
we all learnt somewhere
then again having 10+ years programming experience before using UE4
you kinda understand things by looking
but i can understand someone with little programming experience struggle with things like this
Okay Im back again xD - When I spawn in the Enemy_bp manually it works fine. If I use this actor to spawn it in, it dosnt move, any ideas?
LOL.
@inner ginkgo I think its becuase the the custom event "MoveTo" is only running on begin play. Can I run a custom event from the Enemy BP on the SpawnEnemy Bp?
Oh, I remember that setup, now. How were getting the target, again? That's probably the issue.
Btw, Begin Play is executed no matter how you spawn it.
there is a special node
Spawn AI
for spawning AI
more likely havent got a controller
that is why it isnt moving
Yeah but the Enemy spawns 3-12 seconds after the game starts, so they are not there when the game begins, would that not cause issues
Show that code again, please.
Which one, the MoveTo event or?
Your move to loop.
This works fine if I spawn in the enemy manually
That looks fine. Check under Class Defaults.
Pawn -> AutoPossessAI.
Make sure that reads placed or spawned.
Okay might sound super stupid here, what is Class Defaults?
It is a button on the top bar.
Ohhh class settings?
Class Defaults is next to it.
Shhh
π
Aha, gonna want it to be placed in world/spawned π
Yup
Is my math wrong or can the line trace almost never end up on the crosshair all the time?
@stiff hatch The math is "fine", but you are both aiming at a point that is the weapon's range away. So the triangle you form is colliding before then.
ohhhh!
What you can do is cast a ray from the camera (deproject might be more reliable) and use that collision for where to then line the gun up with.
so the deproject is kinda a line trace on screen?
It converts screen space x/y into world spawn x/y/z.
There's project and deproject. I always forget which one is which. One goes from screen space to world and the other does the opposite.
ahh okay.
So you get your x/y of your reticle and then deproject it. to get a straight forward line.
it ask's for screen position. How can I always get the center of the screen for the screen position considering it anchors to the corners
anyone know where i can find the modulo operator? (Determining if int is odd or even)
% is the mod operator.
thank you!
Is this something to worry about?
@stiff hatch Been a while since I've done it in UE4. If you can't get the widget coordinates, then take the resolution / 2.
@arctic rune I always worry about every error, lol.
Do you have the project open twice?
Idk if im being dumb or something but is there a way to get current screen resolution
@inner ginkgo No, but I did accidently open up a node to try something. Im guessing its that?
GetViewportSize
@arctic rune Opening a file in the editor shouldn't stop it. If Retry keeps failing, something has it locked. Can try Cancel and then attempt to save it again.
How would I go about spawning actors in a group, but never spawn overlapping each other..and then 'scaling' in size slowly over time
For the first part, there's a collision handling override that lets you attempt to move them before placing them. But that's going to be up to the engine how they get moved and might not be the best.
Do they need to be random? Otherwise spawning them in a uniform grid shape would get you non-overlapping results.
As for the scaling, what do you mean there?
They spawn scaled? Or the actors scale themselves over time?
Srry to interrupt but I tried this and all it does is draw a line from the muzzle to the center of the screen. I feel as though I misinterpreted something
You need to do 2 traces here. The first one straight out from the screen. The 2nd is the trace you have, but the end point is the collision of the first trace.
if there is going to be 2 traces I could just use the forward vector of the camera instead of adding more math.
I thought that this would only use 1 trace
Gotcha, sorry no. The forward vector might work fine.
okay, I have one more question
weapons have a range to them and the trace only goes as far as the range. how would I incorperate it? would that be on the first cast?
Yes, you can do that in the first cast. And when you are out of range (no hit) use the Trace End as your end point for the second trace.
one last question (also thank you for the help btw!)
is trace end the hit point as well?
as in if it hits something the location of the hit is the same as trace end?
or would I have to use impact point instead with some select node
I do not actually know, to be honest.
okay, just to be safe I'll use a select for "hit point" or "trace end" until I figure out that.
one last question (also thank you for the help btw!)
is trace end the hit point as well?
as in if it hits something the location of the hit is the same as trace end?
@stiff hatch trace end is where the total of the trace ends, the hit point (impact location) is where the trace hit something
Thank you! so in my case I would need a select
np
anyone knows if when pressing two input actions at the same time, one of them doesn't fire, and they're not requesting the same keys, what could be the issue?
I'm having a weird issue, I have a sprint and a dash, when pressing any other direction other than forwards (W) I can fire both of then, but when pressing W one of them doesn't fire, really weird
how can i create a directional light component that is client side only that tracks the local player camera?
you actually answered your own question @undone timber
just instantiate the component if the pawn/controller IsLocallyControlled on BeginPlay
my issue is that this component belongs to an actor that is replicated... so i have a mental spaguetti
basically, star provides light, for each player, but players can be in different positions so i need the starlight to yeah be instanced per player client side only
but it is still stuck to said star
actor being replicated doesn't mean its components are replicated
any component on CDO is net addressable, but that is not the same as replicated
any component spawned at runtime isn't even net addressable, unless you explicitly mark it as replicated
so replicated actor can spawn components that don't replicate, different components on different machines
ohh...
this component is not spawned, so if i were on tick to use a switch to make the light track the camera authoritative player, it would track only the local player?
you should spawn it in for performance sake
component transform updates are pricey
but you could put it on CDO and just enable/disable it depending if its local player's or not
tick should be in no way involvd
yeah i am kind of new... i still dont know how can i keep some things updated without using ticks or an event that runs every second or so wit ha timer
like... how to keep the glow of a star to keep cycling
without using tick
(like the first version of my game had everything on tick... then i understood the horrible performance penalty and switched to events everywhere, but some things that need constnat updated i just... can't figure how to
no tick, no timer
component won't magically migrate to another machine
it needs to be spawned/enabled/disabled once
okay
that part i get
but after that, how do i blueprint it to track the local player only for each instance?
for example (if spawning on the playerpawn) BeginPlay-> Branch (IsLocallyControlled) True -> AddComponent
is not on the player pawn
this is for a star, a literal star
i am using a point light with a gigantic radius right now, but obviously that is terrible performance wise (not to mention you can have multiple stars)
and players fly around it
what is the exact purpose of this component?
hmmm, nvm
you can have whatever is holding the player camera register with each star, if its local player's camera
and star would then adjust its non replicated directional light to track the registered (local) player
well.. to illuminate the map for the players but it need it to be logically consistent
oh i get what you mean, so component is not replicated, players register themselves with star component, component on each star just tracks the self registered player
pretty much
+/- the component part
as star actor is quite capable of tracking a reference to the local player itself
oaky so all of this i know what to do then, except a single thing
how to find the star actors?
how do i run tick logic just locally?
you don't have to
nah my gmaemode alreayd keeps track of stars and stuff as the maps are generated procedurally and so i needed to keep track of them for saving purposes
each machine has one instance of the same star
each machine has one local player that registers
each machine on tick adjusts its light to track the local player
ohhh.... i see
all the ticks run locally
okay perfect, last question for now... which node exactly gets the current local player
i am 100% new to the network part so its driving me a bit crazy
in case of dedicated server, you don't do anything if no local player registered
because as i understand players always get replicated everywhere
IsLocalPlayerController i think for PC, IsLocallyControlled for pawn
for other stuff you'll have to resolve it via PC or Pawn
oh okay
okay i got it , thanks a lot
oh side question... do you know if in blueprints i can create a constnatly updating function in a parallel thread? some of my ticks (very few but still) are being use for things that i know can be run async or totally separate (think target tracking (as in space tracking for targets)) or some animations like that of a texture glowing...
also if you haven't already
goto #multiplayer , check pinned messages, find NetworkCompendium and give it a read
oh god... i know as much about shaders as an ant about quantum physics...
i would definitely not attempt to do any multithreading in BP
for something as trivial as simple vector math i would not do it in c++ either
it is vector math but more like a in game targetting computer that is showing information on the UI to the player of the closest 4 enemy targets, and some of their statuses (so it is just reading information from memory)
that hardly requires multithreading
and UMG will crash if you try to run it off game thread
oh it goes when you have thousands of objects on map ...
i mean so far i got my performance acceptable but is just borderline acceptable
structure your data better to allow faster queries
depending on your technical background, consider using c++
few things are as inefficient in BP compared to c++ as custom sorting an array
i can use C++, i have just been trying to push the blueprints the most possible before i start converting to c++
figuring out what are 4 closest enemies from list of 50 of them is downright suicidal in BP
oh no i use something smarter hahah
you use 2 screens of space to do equivalent of c++ one-liner
i use an event with a collision sphere
to register and unregister enemies within range
also, networking code is best avoided in BP if you can help it, as it has ~10% of the available tools
collision spheres are typically pricier then sorting large arrays
that is with 60 actors
this is with 1150 actors
all moving and doing stuff around, plus gravity effects and such
(yes it hammers the cpu on world generation)
i'd probably have everyone just register with closest planetary system
instead of using overlaps
the overlaps are also what handle enemy spawning and partially gravity effects
i am also not sold on procedural generation of a networked level in BP
we have a 33k actor procedural level, that is fully spawned, networked to 8 players and ready to play in 12 or so seconds
and we accomplish that by not actually replicating anything until play starts
except the seed
i mean just creating 3d gravity that worked for every single actor on the map without killing the cpu took me like a week to sort out
(every actor on my map (asteroid (thousands) planet, moon etc, has gravity force
and they all affect every ship, or is it just the closest celestial body?
its own gravity force as ue4 gravity only points downwards
they affect every ship within certain radius
of course if no ship is within that radius the logic turns off
don't know about your scale
so yes yo ucan have n body gravity
where a single ship is affected by the gravity field of multiple objects
but overlaps updates go O(N^2) with the number of ships
yep.. i know
so put 2 fleets of 200 in the same area, and it will be a disaster
its why i use overlaps just to register and unregister ships in range
but yes i am aware right now half my game performance is getting hammered by overlaps on large maps
you can do it with smarter registration system
each celestial body tracks other celestial bodies which are close enough to affect it with their gravity
each large enough celestial body to matter tracks the ships in its system
and you eliminate the need for overlaps
so create an array with the position of every relevant actor, calculate the distance to each actor, and if the distance is less than radius, do gravity?
ships know what celestial body they orbit/fly in proximity off
so it pulls that body's array of close celestials
and applies gravity effect for each of them
ships can be affected by multiple objects the ships themselves dont know what is pulling them, they just get messaged to receive a force push towards some direction
and always do distance squared checks instead of distance, its cheaper when you don't calculate square root a million times
its the same for the spawning logic, asteroids have a collision sphere, something gets into it, they trigger the spawning logic
so... remove all the collision spheres, and make gamemode track all the positions of ships and players? or every actor itself tracks? brain explodes
not gamemode
each celestial body tracks celestial bodies that can get close enough to be gravity relevant
each planet or so tracks ships in orbit/proximity
that means hundreds of moons and planets...
thats faster than overlap events?
and have the references set in editor each time you save a level
that way you don't actually do anything in runtime
and there you can use more expensive logic
that doesnt help when the level is changing dynamically constantly tho
but i get what you mean
that is true
i dont have to create all the references just add the new ones
in bp your gonna struggle to make it "optimal"
tho 99% of my maps are randomly generated
also, a periodic overlap check is far cheaper then an always active primitive with overlap
you would ideally offload the math to another thread
oh i know, and i will switch to c++
just trying to do as much as ican on bp before i switch
kinda pushing myself
you should just switch to c++ now π
you know how inconvenient it is to have to write everything?... π