#blueprint
402296 messages Β· Page 793 of 403
you understand what i am saying ill try that out
Id also consider some ik for pointing the gun correctly but idk if that would work properly
You use one trace from center of screen for aiming precision. If this hits something you use the hit location if not you use the end of the trace as a hit location. After that if you are firing projectiles you spawn them aiming at that point. If you're using line traces for damage, you line trace from the weapon's muzzle point to the hit location.
this is exactly what i was thinking
The extra math there just keeps the line trace from camera from starting behind the character, so you won't shoot things behind you in TPS mode.
No TPS mode FPS, but the TP character needs the corrective line traces the way you are saying this as well
awsome stuff!
how basic you say my line trace was
LOL
hit location is on point
Yeah
But if an object is to close to the screen
Warping a bullet sideways will look weird
Like if you directly face a wall
and turned 45 degrees
yeah
im going to try your method, and see what i can come up with @maiden wadi
thank you bud
Authaer's method, ye ^^
can i change this to point camera to in front of gun? and get the socket location of my muzzle?
and still be using the camera location and rotation?
how can I remove a child mesh's parent without deleting the mesh?
I essentially want the child mesh to become its own object
through blueprints
You can probably ditch the projection. Just a line trace from camera center to camera direction. Ignore self. Use that to set a value that your animgraph can aim the weapon relatively towards. Then just spawn bullets or do traces that look from the weapon muzzle point to the targeted point.
and it becomes blank
Sounds a bit more clear thanks
Hi, changing an existing structure crashes my editor. Anyone has a fix? I am on 4.26.
changing how
Doesn't matter. Rename variable, add new variable, remove variable...
is it in use anywhere?
yes
Okay... found a workaround: Migrate structure to other project. Do your changes to the structure in other project. Close your actual projects editor. Migrate structure back to original project.
Sounds healthy. Consider a cpp struct instead :)
Will certainly do on my next project. Converting my current structures would be a too big pain in the butt. I make use of them extensively in BP and data tables
It would make me happier if Epic would just fix their implementation of BP structs π
π
They removed it?
Wth
It's still there in 4.26
but it's buggy. Game behaves differently with nativized BP
Hello guys does any one know how to implement advanced locomotion with horror engine? .
To Implement Horror Engine it needs a player camera but ALS already uses a ALS camera in it.
Hello.
Whoever has faced this problem?
Widget no see.
is there a way to have a string value accessible from anywhere
game instance or function library doesn't work for objects
its a constant not something that changes
Hello , when i call actor from variable it give me error
how can ifix this or call variables
it cant know the class in advance so it cant make those i pins available
you could cast it after the spawn and set the values
If its a known baseclass, surely the pins can be exposed?
E.g. bp_master_weapon class?
Your ammo actor class ref isn't specific enough for it to know that the resulting actor would have damage and crit stats.
I doubt it's a known base class, ammo actor is prolly just an actor class
First mistake then imo
@velvet forum Show the Ammo Actor variable type
Hi!
Is it possible to move and deform one static mesh along spline?
reference - https://www.youtube.com/watch?v=W9qXdk09T3A&t=1s
Probably? Look at the how the content examples did their spline road. If you can animate where the spline mesh is along the spline and it's length you can probably do that.
Just wanted to mentioned, I've managed to put that to use to the point where I now have successfully made it where a turret and a driver seat exist and both have their own functionality, so cheers again π
@odd ember Figured it out
I don't want my item attaching onto two different meshes,
I want my item to attach to one mesh if the player is locally controlled
and I want the item to attach to the other mesh if player isn't
I realized I could do the proper checks in a RepNotify function, instead of a server or multicast rpc
good that you found a way. I'd still not recommend doing it that way, but it's up to you
the previous attempt at two different items, one for first person, and one for third person proved to be tough
since components such as lights don't have a 'Only owner sees' and 'Owner no see'
I can't figure out how to get a flashlight to work with two separate meshes
I personally started following epic's example of that. Just easier with two meshes.
have you asked in #multiplayer at all?
I did. but didn't get any traction. I remembered that @maiden wadi actually helped me to get this current system (of getting the actor to attach to the correct mesh) in the first place
a long time ago
so had to go back and look at a previous example
welp @maiden wadi I blame this squarely on you π
lmao it was like a year ago. can completely understand that opinions and workflows change
I keed
From a programmatical standpoint, it's wasteful. But from a design and organizational standpoint, you affect those two meshes differently usually with animations. Just easier with two different ones.
not to mention any sort of performance optimizations would be easier with two meshes rather than one
yeah, I'm just having issues other than animations. like lights. since it's proving hard to selectively turn on lights for some, and off for others
if I can figure out how to do that, I'd consider going back to two item mesh versions
Hi. Is there a way I can only trigger an overlap on a certain collision box on a player and not the whole actor and his subparts that have collision enabled. I'm trying to do a room transition and want it to start when his hitbox overlaps the trigger box, then disable collision on the hitbox while he transitions rooms and then reenable after the room transitions.
I believe you can check for collision against a specific component
you can use that to check against the specific mesh you are trying to detect
Hey, is there a way to eject and possess in blueprints?
oh let me try that
when i make (spawn actor) to asult ammo will give me every pins
and when i plug ammo actor class the pins not avilable
@velvet forum Show the variable TYPE for that Ammo Actor variable
Where you choose if it's an int or a float or a class reference etc
likely you haven't ticked 'Expose on spawn'
He has but I don't think Ammo Actor is of type BaseAmmo class, it's probably just a straight up actor class
ah I see
you were right
@velvet forum change from Actor class to BaseAmmo class or whatever all your ammo inherits from
Spawn Actor has no idea that the actor has to be of type BaseAmmo so it can only expose the variables exposed in Actor
Well guessed Adriel
Sorry for asking again but my question got way up so I am writing again. Is there a way to eject and possess in blueprints?
When I possess it is not the with I click possess in editor
not the same*
Or can I start the level in PIE in blueprints
you can always make a keybinding that has the specific rule of toggling between spectator pawn possession and real pawn possession
When I possess a real pawn the editor is still in simulation mode not in PIE. The cursor is different and there are many stuff on the UI
Basically I want to start the game in PIE in code somehow
so i have this cylinder!
in construction script is it possible to make a triangle setup of these? so that via 2 variables i can set the size of the triangle?
so i set Width and height and the blueprint in construction script takes care of setting it up?
@odd ember yes
cool, you, should have everything you need then
well all except i dont know how to set it up
it's trigonometry. something along the lines of width * 0.5 would determine the center location of the triangle, and then you can use spacing as a measurement to spawn each cylinder
how do I connect a Texture 2D pin to an Image one?
can you show your logic?
I probably need to make a brush from texture I guess, but still don't know how to continue from there
do I need a material? it's just a 2D UI icon
alright thanks, but I can't see how to get the image from the slate brush
@knotty pebble Are you trying to display a simple icon from a Texture2D? Not entirely clear on what you're after.
Ive created a rotating rock with blueprint, simple set up. It rotates in simulation, but Id like to actually have it play in the sequencer to export with the movie queue. How do I get it to play in the sequencer mode, here is my set up
probably better to ask in #cinematics
yes, I have a Texture2D and I want to render it in an Image object, at runtime
and you can't use a material because...?
Make a UserWidget. Add an Image, call SetBrushFromTexture or just set it manually in the image details.
Unless this is for 3D stuff. In which case you're probably more closely looking at a single plane with a Material. Or a Decal.
So, I have a very extensive Next Level XP thing that works perfectly
My issue now is, how would I apply this to multiple things? I have Character Level and Ability levels that run off the same Xp calculation how would I be able to apply this to multiple things? Would I need variables for each thing or?
Need more clarification. You have a character level, and an Ability level. Do these level up at the same time? Can one character be a higher level than another with the same ability, but have a lower ability level?
They level up independently
Yes
Sounds like a method for calculating current xp level is in place ?
Feed it a total amount of xp, get the current xp level out ?
Yeah I already did that, and have an extensive Next Level XP calculation
So if you feed it XP the Current XP goes up when it hits the Next Level it resets Current back to 0 and the character levels up
Then increases the required Next Level XP
No overflow xp?
Yeah if theres overflow it carries over
Id just have a total xp really
Make functions for getting level / progress and whatnot
Whenever you get xp, check if the new level differs from the old level, if so, fire an event for leveld up?
Sounds like you need multiple variables then. If character level is independent of ability level. There's no way to save ability state without it having it's own value.
^ true. It would be 2 variables , one for ability xp and one for level xp in my proposition
So heres the weird thing
XP is a resource so you just get XP and it goes to a TotalXp variable
Then you spend XP to level yourself or your abilities up
Got a box with this render properties gone in the cameras rendering but visible on viewport any ideas ?
Then yeah. Each thing that levels needs it's own XP value.
I figured i'd have to have variables for each, but is there a way I can re-use the previously created Next Level XP algorithm instead of recreating it over and over
Really not sure without knowing the setup. It's a very difficult question to answer without knowing the framework. Presumably you have something of a function that takes in a level and tells you how much you need for the next level and then another function that tells you if you can level up something based on it's current level and your current accumulated XP pool. Of course this just spirals into complexity if you need different xp values for different abilities or abilities vs character.
Unfortunately, gameplay programming like this gets very complex very quick. It's one thing to make a simple leveling system for multiple objects. It's another one to design one for a game in an easy to use manner that can also be balanced later without disrupting players too much.
Yeah, the leveling system I have is extremely complicated XD
The problem where this
Turns out the purpose of this is to don't cook on final build
but don't render the actors in editor 
Honestly sounds like it should be very simple but im probably missing alot of stuff:p
Thanks that worked, but I had to replace the image for a border object
hey guys! i'm working on the binding key settings, and i'm stuck at the gamepad part. There is input key selector, wich should be activated only when the gamepad is used. Prob is, i can't find a way to say "only if gamepad is used". I've tried to break the key and switch on the hand, but the hand doesn't seems to be defined at all
Hey I hope I can ask this question and possibly be pushed in the right direction. How would anyone recommend handling character species? In my game(minus dlc) I plan to have players be able to choose from two different alien races to be descended from. Should it be two different actors or should I try to make a race component that has all possible options for a characters(player or npcs) species? Any advice is mucho appreciated
This depends entirely on what the species does
My actor blueprint has a struct variable which contains an array of structs. I'm hoping to reference a static mesh component (or other components) in the same actor within this struct variable. Is there a way?
The "Yard Mesh" lists nothing, and I can't actually drag/drop the reference into here either. Guessing this is just a misunderstanding on my part. I could use a Name variable and component tags for association instead I guess.
Sounds like something similar to classes in RPGs.
So the starting location for the player will be the same but depending on the species of course you get different dialogue options/reactions, different homeworld (to eventually travel to as the player starts on earth), different skill trees etc
I have been pondering that
But I wasn't sure if I would extend it further and have different classes for the different species
@indigo bough Not without setting it. You can probably do it in the construction script.
Nah, nothing really special per se, you could have classes for classes.
I see, yeah that was one thought I had, but complicates things a little. I guess in the construction script, I can use the name/component tag, find the component and set it within the struct.
Nice. Any tutorials or further advice you could shoot my way to get me in the right direction
Is this struct and components not in the same actor?
Yeah, this is all in the same actor
If you know which index, all you have to do is set the struct parameter directly.
That's the thing, child actors will have different length arrays (with different references for each index from the parent). Fun π
I think I'll just add a component tag to the relevant mesh, forloop the array in the construction script, find the correct tagged component and assign it that way.
But thank you for demystifying it for me
Fun days. π
Something like this:
quick question, is there any node to check if character is pressing any input? I want to cancel an event if any input is pressed
@rose citrusPretty sure this works. Have not tested myself.
If you need an actual event, there is an AnyKey input event.
I was just trying that and noticed gamepad doesn't have an any key option
I'm trying to put it in a function which anykey input can't be put it. If it could I'd put that in the function with key is gamepad key
Ah. Very little experience with gamepad stuff. You could make a project input with all gamepad buttons and check that, it's fairly simple.
I do that with keyboard keys at least. It would work the same with gamepad buttons. Axis would need some extra code.
yea you're right. Thanks!
any idea why i cant set a custom component as a parent class?
Have you tried making a new BP class from ZombieInteractComp class directly?
Im using a c++ component class as parent (reparented, as you're trying to) with no issue
Whats the parent class of your component ?
ActorComponent
Also make sure to close the editor and compile everything first
for the inventories, wondering if anyone could help me, creates a set amount of slots to fill up but id like to figure out how to change it so its weight based so can add as much as you want aslong as it fits in the weight
so only creates the inventory slot if populated with an item
Just set the hbox in a scrollbox, set both to fill at 1.0. Only create and add widgets to the HBox for the items you have.
not the thing i was talking about, thats just compressing it
kinda inventory style im going for
The X part just needs to be not sized. Remove any sizeboxes or whatever that control Y size or height.
hey guys could someone please help
I'm watching a video https://www.youtube.com/watch?v=QIPoMtrdkic
This Video:
In this video, we create a laser particle effect. Making the effect more dynamic by control the colour and length through a blueprint class.
Niagara Particles:
This playlist is dedicated to the Niagara particle system acting as an introduction to some of the basic concepts of creating emitters and systems.
Consider supporting the ...
and if you go to 19:14 in the video
the guy has so many options in the LineTraceByChannel
but I don't
I use 4.27 version
Right click the blue OutHit pin and Split Struct.
ohhh, thank you
A Struct is a container of properties. OutHit is a struct. You can access them by calling Break or by splitting the struct.
random question, how would one make a varied jump height (one where the longer you hold down the jump button the higher you go)
i feel like iβve seen it in the character movement component before, but i donβt remember where
it is in the cmc π
where exactly if you donβt mind me asking π
Holding down button before or after actual jump?
my bad, not cmc, but the class
can i get a screenshot?
select the "self" component
tippy top component thing
Hey, probably an easy one - I've modified the third person character so that my cursor is enabled by default, but when I press and hold RMB, I can only rotate the camera around him so much.
Anyone know how I can make it 'infinite rotation'?
got it. thanks
Got a wee interesting thing that I guess might be a simple fix
issue at hand
Animation blueprint contains 2 variables
TurretRotation (Float)
TurretYaw (Float)
These are being accessed via another blueprint class that provides the variables with a value on the rotation of the mouse. (So mouse X and Y go respectively to TurretRotation and TurretYaw)
However, when the connection on the image below is not made, I can alter the values and the rotation works just fine. When the connection is made, the rotation will constantly reset back to 0, even though it holds the value of (let's say.. 90)
What I have checked/tried so far
- Animation Blueprint's Transform (Modify) Bone rotation mode is set to "Add to Existing"
- Tried manually altering the values on run-time seeing that it'll be to due with how I am passing the variables to the animation blueprint or not (At least I think it is)
-EDIT-
Noticed that in this screenshot both turretrotation and turretview aren't assigned, normally they'd be linked to Mouse X and Y respectively
RESOLVED
Answer: I was not 'adding' it, my assumption was that the "Transform (Modify) Bone" rotation mode set to "Add to existing" would add whatever value was passed through ontop of the previous rotation.
It did not, so adding a simple "Add" with the target being the rotation or yaw and then adding the new value (the mouse X/Y) ontop of it made it work nicely
@lament ginkgoNeed to hide the mouse cursor and change the input mode. I do this but it's in C++. More or less I press camera rotation button. Mouse hides and calls SetInputGameOnly. On rotation button release, show mouse cursor and SetInputModeGameAndUI
@lament ginkgo Oh. Still have the nodes. π Not sure if the C++ will help.
void ATarrionTacticalPlayerController::SetDefaultInputMode()
{
FInputModeGameAndUI InputMode;
InputMode.SetLockMouseToViewportBehavior(EMouseLockMode::LockOnCapture);
InputMode.SetHideCursorDuringCapture(false);
SetInputMode(InputMode);
bShowMouseCursor = true;
}
void ATarrionTacticalPlayerController::SetCameraRotationInputMode()
{
FInputModeGameOnly InputMode;
InputMode.SetConsumeCaptureMouseDown(false);
SetInputMode(InputMode);
bShowMouseCursor = false;
}
Cheers! I'll give this a go, thanks!
Works like a charm, thanks! You wouldn't happen to know how to disable the same behaviour for the LMB, do you? Seems to be doing it inherently somewhere - guessing a variable.
What is this using? What are your input events?
Well the one I made was just an Action Mapping (RMB) but it looks like if I hold LMB, that also performs the same action; but I have no mapping for LMB right now.
All I've done was take the basic third person template and on Event_Begin for the controller, enable the cursor.
Oh wait
I'm a stoop - nevermind
I still had the old InputAxis commands setup lol
Ah. π Yeah. I handle input a little differently. Have like three keys for holding to rotate camera.
I'm trying to basically emulate the control scheme of a very old MMORPG; Asheron's Call. Basically it had full turn controls with A/D and a stiff camera, but you could hold down RMB to turn the camera and hold RMB/LMB to fully steer with the mouse. This was sort of the big hurdle to get over.
hey i have a bit of an issue with ue4 which has been going on for months. when i right-click in blueprint event graph then the search box after a while doesn't show up or starts flickering very fast, it doesn't render it basically. that is until i restart the whole project. in other times when i open 2 different projects at a time, one of the projects starts flickering really rapid, and also google chrome goes blank. what could be the issue?
it's become increasingly annoying so thatswhy i basically require some help now to fix this (if it's even possible to), using rtx 2060
See pinned message on #ue4-general, that's an NVIDIA issue.
thanks, i saw that like a week or two ago though by googling it up - i tried using the mpo_disable.reg twice, it wouldn't work at all. i think it has become even worse
perhaps there are any other fixes?
Blame Jensen Huang and his leather jacket lmao
I have yet to see reports of similar issue from AMD users.
can anyone explain why i can't get this text to be visible on start? i have the wait for loading node to show, it only works if i let it wait a bit to push the command. i have the texts visibility to off, it doesn't even show in the editor, but as soon as i hit start the text is visible again. it just simply won't not be visible at start and if i just set the visibility at event beginplay it doesn't do anything unless i wait a bit
i just need to start up the game and the text not be visible
Please do not cross post unless directed
:triangular_flag_on_post: arakrates#0968 received strike 1. As a result, they were muted for 10 minutes.
Anyone able to assist me in a trigger for picking up objects to change levels, I want to make it a pickup level changing trigger and theres not many videos on it
Does anyone know why the navmesh wont show up? Pressing P won't show the green layer.
does the mesh have collision
well.. it shows in the gif itself: component overlap is being called so it is becoming visible (not sure if someone answered already), pretty sure the pole next to it is triggering the overlap event, if not a collision box on the player, if not the ground, if not something else that can overlap with it. generally you want to test the other actor pin from the overlap event to see if it is the player class or change the collision settings on the collision sphere to only overlap with something that is used on your player, like pawn (granted, other pawns will still trigger it then) ...
(other actor -> cast to yourplayerclasshere -> code) ,
or use an interface (other actor -> does implement interface branch -> code) ,
or use an actor tag (other actor -> has tag branch -> code)
tldr; component begin overlap triggers on beginplay, so if it overlaps with anything (that it can generate overlap events with) at the start it will run the code
Hello. I'm going through some BP tutorials and one thing I learned is that it's not possible to prevent a parent's events from being called if the event is from a component. Just curious why that is?
Still learning the ins and outs of BP but it seemed like this lets you prevent parent events from being called with things like Begin Play, so I assumed that same level of flexibility came with component events.
Hi i need help, i have a turret on a helicopter and i wanted to make sure it always aim at the crosshair, can any one point me to the right direction on this. here is what i got
If you have a Child object, the components are inherited and can't be removed. For events, you can override the parent event by calling it in the child blueprint.
What I was experiencing was that the child can supplement the parent's events, but I couldn't override it. The example situation I had was a parent pickup class that had a sphere component. The sphere's overlap event in the parent did some logic.
Then I had a health pickup class that was a child from that parent. I could select the inherited sphere component and layer on logic in the child as well - but I could not prevent the parent's overlap event from being called.
With something like Begin Play, I saw you could prevent the parent from being called just by having the call to parent node disconnected. But component events don't seem to let you even deal with the parent in that way (the option to call the parent event is grayed out and it seems that it just always calls the parent, regardless of what you do).
Ah yes you are correct. Since the overlap event is part of the inherited component, it too is immutable and inherited from the parent. BeginPlay is an event not attached to an inherited component and therefore is treated differently.
Usually the way you have to deal with this is just ensure your logic is taking place in the right location. You may need to move it down to run in the child vs. the parent in cases where you want to manipulate it.
Okay, thanks Khade!
You could also make the original event more adaptable through settings
Thats how i solved it on my attempt albeit not the most graceful method in the world i guess
Yeah the particular tutorial I was using was not architected in the best of ways. Very brute force. Admittedly I was just trying to clean up something and move to the next lesson and didn't care about architecture as much hehe. But when I was messing around I was like huh...I guess you can't override these in a similar way.
You could also leave the implementation to the owner but that defeats the use of a component
Hey sorry didnβt see ur response. Itβs just the default nav volume. For some reason it wonβt work in any new new projects I start. Tried setting it to blockall or overlapall but it still doesnβt seem to work
If I want to modify the material of a mesh during runtime do i need to create a new material with my desired attributes and then set material on the mesh again?
Or is there a way to get the material from the mesh that is editable and just works?
I've noticed I can hot change the material if i have the "Material Instance Dynamic Object Reference" I used to create it, but in the instance where I'm just grabbing the mesh I haven't figured out how to extract the right material.
Mesh > Get Material gives me the material in index 0 which is what i want, but its of type "Material Interface Object Reference" and not "Material Instance Dynamic Object Reference" and casting it to dynamic fails.
they meant the mesh you want the navmesh on
sounds like you want to make the MID at begin, then assign to the appropriate slot. Store it as a variable so you can reference it to set the params elsewhere
That seemed to work, thanks.
I'm seeing something that seems kinda strange to me.
If I put logs in my construction script for arbitrary actor bp it seems to print 6 times. are all my construction scripts running 6 times by design?
i think construction scripts run during editor, but i dunno, never use em, they are editor-side afaik
interesting. I'm using it in my grid to draw the lines for the grid and what not, which was fine before; but I just decided i needed an array of dynamically created procedural meshs and when i logged the length of the array after finishing it logged 6 different numbers all in the 1000s when i at most pushed like 24 things on the array.
maybe i should refrain from doing anything spicy in the construction script
it also seemed like it started slowing my editor down to a crawl
that's been my annoyance with cs, i wish it was a bit more flexible, or there was a way to still edit stuff while the game runs like in Unity
I know there is a function that I can use instead of this work that I did, I can set a Max and Min number with that function, I forgot its name, please anyone who knows its name help me
clamp
I'm absolutely tweeking. This is the only time Tiles is used and it's printing 4152 as the length.
like what
i made a new variable of the same type and it's 0
wtf is wrong with the other one
when i find references of the other one it only pulls up that one spot
in all bps
Any1 knows how to switch to camera on enemy char. Tried set view target with blend but its not working
assuming you have access to the camera component on your enemy char, this is what i do
and this is the custom fnc at the start
you also need an actor somewhere in the level as a reference for where you're moving the camera, which is what that getting actor thing is
or i might have misunderstood your question. you're trying to switch the camera you're seeing out of as the protagonist to the enemies camera?
where are u setting camera . You are just setting field of view??
I'm setting the world transform of the camera which is the location, rotation, etc
i have a camera in my world and i grab that actor get its transform and just set my players camera to that transform
i am asking about switching cmaera from one to another
are you aware of this though
That's curious. then how would you uniquely identify an actor in the list it returns? if their name is just the name of the object, so you'd have like 50 objects with the same name
or get an actor at all
i guess you could make a unique class for every element you want to get.
also isn't there a get actor from class and tag? are the tags fine?
tags would work yeah
I have a strange issue with my dynamic material instances: The material works fine as a standard material, but as soon as I create a dynamic instance and assign it to the mesh I get gray checkerboard material π¦
Mmh I'll try
But compiling shaders should finish even I am not in play mode
Any1 knows why set view target with blend not working when i try to switch to camera on AI character
what happens when you switch
it goes to cmaera on my player isntead of enemy camera
Seems to be some issue with me assigning parameter values or something. If I delay the material instance creation by some seconds it works o.O
can you show the code of where ur setting view target with blend
Got it fixed. Moved the instancing to a more appropriate place
Using a manager class here can also make sense. Camera subclass -> register to cam manager , which then has functions for retrieving a specific camera based on a tag (i used gameplaytags)
Interesting, so you basically switch the camera you're using to a placed camera as apposed to moving the player camera to the location of the placed camera
If appropriate, yes
You could stick to one cam if you want and do the same logic for a regular actor, and just getting its transform inatead, if thats preferable
Managers are great for this
interesting, found this article off of searching for camera manager
https://unrealcommunity.wiki/player-camera-manager-227ae5
i'll have to dive into that some more
The PlayerCameraManager is an important aspect of Unreal Engine and good documentation around it is somewhat sparse. This page exists to try and remedy that.
Yeah the manager exists aswell
Custom class there can also make alot of sense
If you want custom behaviour for the camera,
Doing procedural mid-fight animations and whatnot
Or just custom reacton to enviroment, or generally just how thr character moves
I'll likely be needing a good amount of that. haha
Also i have no idea why this was happening still, but I just deleted the variable and recreated it with the same name and placed it back and it works like it should.
Might have somehow been a remnant of when i had my array pushing logic in the construction script and it started wacking out my editor. i had deleted all references to it in the construction script, but who knows.
Looks like tiles is a struct
yeah it is
Danger danger :p
lol
Make it a cpp struct and watch all problems fade into nothing
are bp structs bugged or something?
Is there a way to set Owner No See on a mesh (that is easy) and propagate that to all its children? (that second part is what I don't know)
If the last array was named the same you could have issues behind the scenes aswell
They're not great, thats for sure.
Curious. That does bring up an interesting question, which is: how good should i be with the bp engine before swapping over to doing stuff in the actual code bits.
Like I'm a software developer by profession, so coding, especially in c isn't really a problem. but there's so many specifically named functions for unreal and what not. does the code editor have the same amount of "intellisense" as the bp engine does?
i really don't know, if the event runs it should work maybe somewhere you're changing the view target back to the player... try using this event to make sure you're actually changing it
Sounds like you've got a better base than I do, being an automation engineer (conding in structured text) but it was quite straight forward with a few pointers. Some macros are unfamiliar etc but overall not bad at all
Not very into the vs studio but the code completion and 'sensing' is terribly slow. Many extensions are preferred (altho i havnt gotten around to try any)
will definitely end up being a deep dive when i decide to swap haha
Well not many, rider is often used as an IDE
Or VS + Visual Assist
Personally Iβve had little issues since using VS2022
sounds promising
But itβs still fairly slow compared to blueprints
Give it 1-3 seconds to load upon opening a file (before you have intellisense)
k this event runs. Let me check further
so the opening of the file before you have instellisense is the wait, but actually using intellisense is speedy enough?
Once its up to date its fine
Its smart suggestions isnt top notch imo tho
Atleast not for meta specifiers
Hmmm yeah, Iβm just over time becoming more and more independent from all the help π
You get used to it haha
Yeah thats what i figured aswell, so not bothered trying any other extension π
Or rider for that matter
People also complain about compile time often...
Altho I havenβt had any issues myself
Its sluggish
My project is tiny and yet theres like 30 seconds to compile
Which isnt bad in itself, but when learning its horrible
Hmmm yeah Iβve yet to try compile on my laptop
"Was it this way"
....wait 30 sec...
"Or this way..."
..wait 30 sec..
"Or maybe this was how!"
...wait 30 sec...
I will have to in a couple weeks π
I remember building from source taking 4x as long haha
π€£ ouf
Anyway, enough on the C++ side we should get back on topic π
Yy
hi, how to draw the motion track of an object after "setLocation"?
K I think i figured out problem. Bec i am spawning my player and my enemy. Camera for some reason goes to my player char regardless of what i tell it to do. If i dont spawn my player it works fine. But if i spawn my player then player camera takes over. I cant figure out how to fix this??
hey, im making a split screen game + multiplayer, every player has a widget above his head (other players can see its name and hp), in no split screen multiplayer, its easy to rotate this widget towards my player (just check if its localy controlled or not), but how to detect it in split screen? how can i get this kind of information in split screen?
GetPlayerCharacter in multi returns my local player, but in split screen it always returns back the first main player, and i dont know how to get "my player" not a main one
Hi All! Does anybody know how to make smooth camera FOV change using the mouse scroll?
I already can get the current fov and when I roll up, it should increase from actual fov to fov+1. So let's say FOV 15 to FOV 16 but smoothly (not just give one to fov and set it, but like it is increasing by 0,05 continously in a given time, until it reaches 16 then stop and set that). Any ideas? π
Hate to get off topic, but compiling by command line and disabling Windows realtime protection helps I/O speed.
Set/Change a target value FOV based on scroll, the interpolate to it over time
Go to unrealheadertool.target and add a random space somewhere
Recompiling should be slow the first time after that but then quick again later
Say whaat? Really?
Try it out, worked for me
Whenever you change a .h file it will still compile slower compared to if you only change .cpp files but still
What you're trying to do is a pain even in singleplayer. Screenspace is a much easier and simpler solution to this.
In fact, I'm not even sure if you can rotate a billboard two different directions on the same screen. I'm relatively sure that they share the same world, which means they are the same object. Which means it can't have two different rotations.
what is the difference between function & macro on blueprint? i 'never' used macros because everything works fine with functions. can someone explain? π
Macros are just collapsed nodes basically
Functions can only have 1 execution output
Can not have latent functionality (such as delay)
But a function is only compiled once, while macros need to be fully compiled whenever you place one (iirc)
The only honest use for macros is to have variables that save state inside of that one single macro(so two macros in the same object can have different states), which don't pollute your object's variable list. That or to reroute execution to multiple outputs like a Switch node.
Or when you wanna have a function but it has delay π
I also like putting macros I use a lot in a macro library so they can be used in any blueprint
@somber panther Not sure if you had a question?
I had it but someone in VC helped me
.
Guys does blueprint nativization work for you in android??.It is giving some weird cycle error to me??.Can anyone plz help???
@maiden wadi @zealous fog Sorry for tagging.Desperate.
blueprint nativization never worked, dont use it
Is there any way we can tell epic guys to work on itπππ??
Okay got it.Thanks for info
also in android? wdym?
Translate it yourself lol
What do you mean by translate itt yourself @icy dragon
What is wdym?? @native willow
Translate your BP code to C++ code manually.
Currently my laptop takes too mush time for c++.So I am doing in blueprints.
I am building an multiplayer game for Android.So I am trying nativization for android
Either stay with ow BP or convert to c++ yourself. Those are the options.
Don't nativize. Period.
disable this ***
Got it.Thank you guys.
its the same as hot reload, will never work
and will only break your project without a way to recover
(not kidding)
It can be sped up with some tricks, but better manually translating BP to C++ code, or just live with BP.
but screen space is visible through walls
can i make it not visible through walls?
If you're on Windows, sped up C++ compile times by adding the UE folders to Windows Defender's exclude list, and compiling via command line with VS'22 closed.
if yes, then im home
I'm not versed with multiplayer stuff, but at the very least you can linetrace from widget component location to camera.
Okay.
well, thats a problem, in split screen i cant, because its one object, so its visible to everyone or not
Forget the idea of a character, rotate it towards the camera
Can't you just at least make the linetrace not replicated to all players?
you might wanna try to ask this in #multiplayer
in split screen there is no replication, its all local
i will try, but i will ask another question, can i make a screen space widget use occlusion?
becasue that will be enough for me
i just want to rotate widget towards players camera, and screen space is rotated automatically
not afaik, or at least without some crazy shader setups
if the widget is drawn in screen space it has no information about the world space, so you will have some hard time calculating things yourself, id say, forget it and do it in world space
its not being rotated, its just being drawn onto the screen without any perspective transformations
id listen to this guy, this should work
Guys when I view size map of my level it is saying around 700 mb.Does that mean when I am in that level my ram is going to consume atleast 700 mb??.
Profile it, just to make sure. Uncooked size isn't really representative of the final product.
The Android SDK should be at least have a feature to view the RAM usage.
Also when I decrease resolution of my textures using texture compression it is not being reflected in size map.The size same as well
The size of textures are same in size map.Also if I decrease texture size and package it will the decreased version goes to apk or original 2k tex goes to the packaged ver??
2K textures will get packaged, unless you reduce the texture Max LOD Size on Device Profiles.
Okay got it.
What is the proper way in Blueprint to deal with optional return values? For example, if I have a function "Find Something", I may or may not have a "Something" to return. Are there conventions for that kind of case?
IsValid
@trim matrix BP Nativization rarely works. And when it does, it's usually not that worth it. Whatever functions you're trying to nativize that are performance issues can probably easily be written in a C++ base class with very little C++ knowledge. That or optimized in other ways in BP.
OK, so a boolean to say if the outputs should be used or not. Thanks π
I think he literally meant an IsValid macro. If it's a pointer to an object, just IsValid the return from the function before using it.
@crisp lance you have to use blueprint interfaces
If you are not sure about whether the functions implemented or not
Thanks authaer.Will do it
The function is always implemented, it's just that by nature, at runtime it may have a result or not. Like "Find something in the world".
Interface isn't the answer for that. You just IsValid it like Remco said. Pretty common use case.
Hey guys. I have a strategy where I want enemies to slightly "disappear" when they are away enough from players character. Whats the best way of doing it?
use a material instance, add a alpha, lerp from blueprint to adjust the alpha between 0 and 1
hi , i'm trying to move my ai to tagretpoint , or at least to a random location for now just for testing
but cannot get to work, i spawn the ai as a wave, it's a simple horde survival game
then in the ai BP i did this
added navmesh
but they still standing with a default run animation
Is the random location booo true?
And out from the aimiveto, does it say it completed, failed? Debug with print strings
Hi , the boolean is false
So it fails to find a location :)
mm , o did a test addoign a delay to begin play since the ai get spawned in level after couple ms
adding a delay of 1 sec now the logic pass to aimoveto to success
but always did false on findlocation
You gotta soove the nav issue
Solve*
Sounds like its spawned outside the navmesh
i checked it but looks fine i actually spawn the ai inside a boxvolume , it get a random point inside the boxextend and then spawn
but they are all covered with navmesh
i reduced radius of randomreachable to 10 maybe too large for my navmesh, but still not valid point
All i know is that it fails to find a location,
So theres no path from the ai to whereever
If I am using a Child Actor Component to spawn an actor from my Player Character, is there a way to call a function on that specific child actor from the player character begin play or any of the player character functions?
Yes you can cast it to its type and access its type specific functionality from thete
ahh ok cool. Thanks !
ok i was able to do in another way with targetpoint, the issue is now, is there a way i can link a targetpoint to an ai that it isn't placed in level at beginplay?
i have imported an ai to level and added targetpoint pointer
but the logic is only applied to this specific ai and not globally
@trim matrix You can either GetActorOfClass it, or store that target point somewhere like GameState or some AI specific manager.
hi Authaer, this is the Function you made yesterday for spawn wave
Do you have more than one target point in the level?
Then lets consider that. If you add more, what would your selection parameters be for which target point is the correct one?
Fair enough, I'll move my question there, thanks
i will first move all the Ai to one single targetpoint , after logic done i will move always all to another TP
How would you prefer to select which ones are in which order, just an array of target points?
yes an array would be fine, TP1 , TP2 , TP3 and so on in wich i can subsequentally switch in order
0,1,2 in that case
Move to TP0 Done -> Move to TP1 Done ecc ecc
Lets say I have a Actor with 4 static mesh children. Lets say I also dont know what those children are named, how can I loop through that Actor's static mesh children? I know how to loop through child components, but not static mesh components.
@trim matrix Isn't your spawner dropped into the level as well? If it is you could set an array there. Make it InstanceEditable, array of TargetPoint pointers. Then you can just drop your target points into it in order.
how do I then loop through and spawn each one on their own?
I can do the loop
just not the spawn each one on their own
Spawn each one how? Like set the mesh, or create new static mesh components?
like
when I open the content browser, and drag a mesh out into the viewport, it creates a static mesh object, I want to take the static mesh components in the actor and turn them into their own physical objects
When you drag a mesh from the content browser, what it does is creates a new Actor with a StaticMeshComponent on it with the StaticMesh you dragged as the StaticMeshComponent's StaticMesh property.
Am I correct in understanding you want to take four static mesh actors and combine them into one actor?
ah, I want to do that
the opposite
I want to seperate them
And this is from one actor that already has four static meshes?
yep that correct, i did the array ot targets, now i would need to do the logic into the spawner right?
@glad compassI would assume something similar to this.
I think I got it
yoyoyo how would i go about detecting when a first person character does a full 360 yaw rotation in the air after jumping (in either clockwise or anticlockwise)? i've set an initial yaw variable when the player jumps, and i'm checking the yaw of the player when they're in the air but i'm completely lost with the math to find if the yaw of the player in the air is a full 360 from the initial angle.
@trim matrixYeah. You'd just loop through your spawned AI after spawning them. If you want them all to just move to the points, you can pass in the whole array to the AI. Just "SetTargetPoints." Then let the AI move to each individually.
If on the other hand you want all of them to move to the target point, then wait until the rest show up, and then all as a group move to point 2, then you would need to handle that with some callback logic in the spawner.
yeah I figured it out, now the issue is that since I cant directly change settings, I need the collision preset to be BlockAllDynamic, and I cant seem to figure out how to set that
maybe Set Collision Response to Channel?
Ok, in this way is not working i'm trying to pass the array directly to the Ai class
why is a widget being created and displayed when starting a level, but there is no code or blueprint to actually do that?
There must be
not in level blueprint or character, and no other widgets load on startup so not from them
@glad compassIf you want the same as the BlockAllDynamic setting, you can just set these three like this.
@exotic aspen Nothing in the engine adds UI by default. Something in your project that is being spawned into the world at some point must create your UI and add to to viewport. This is one reason it's a bad idea to let other classes handle UI and to handle it all through a manager like HUD class. If you have Widgets on your screen, they had to be created from someplace.
@trim matrixI mean that after their spawning in the AI manager, you could use the return value of the spawning to call a function in the AI that first sets the array, and then starts their movement.
another thing, any ideas how to stop d3d device loss crash every 2 seconds?
@exotic aspen Laptop?
no
Not sure then. That error is common on laptops with bad power plugins because by default losing power plugin will switch their performance graphics card off.
So, may be something similar in PC, bad drivers, or some odd power setting.
Ive done it like this but not sure if its the best way (cause I will have like 100+ other units). Cause I need to set timer to handle material alpha. Probably there is smth better but not sure
Would start by ditching any third party "optimization" software you might have.
ok
ive looked through everything and there is still nowhere the widget is being created
I have a scene capture component. It has MaxViewDistanceOverride set to a certain value. But what is strange is the fact that certain parts of meshes doesn't disappear even when I am more than MaxViewDistanceOverride. What could be a solution to that?
@exotic aspen Possibly easier if you have an IDE installed and can run from it. Could breakpoint the CreateWidget function.
Would be able to give you a callstack to exactly what is creating a widget at least.
Also consider using the FindInBlueprints tool. You can find all uses of the CreateWidget function.
Look at the reference viewer for the widget BP
Hello,
I'm trying to Get Controlled Pawn from a Player Controller passed from a client to a RunOnServer event, but it always returns None, except if I test it with the server, which returns my actual pawn
(All of this is done in an Actor Blueprint)
Try passing and using the player ID instead
Player ID as in Get Player Controller ID? (im very new to unreal)
I believe so
Don't rely on IDs in networking.
That's what I'm trying to do, but as I said, clients GetControlledPawn always returns None 
My goal is to teleport all of them to a location after some Delay (so others can join in the that time-window)
ALSO: I'm trying to reimplement the top-down controller seen in the example. The prefab one brings the player close, but not on top of the position that's clicked on. It annoys me. So I'm trying to fix that.
The only solution I could find online is to use an AIController to actually move the player, and a PlayerController to feed the AIController commands. Problem is that doesn't seem to work: the camera moves to the player position and is useless, and the controls don't seem to work anyway. I can't have two types of controllers possess the same pawn, and the forum post (from 2014 I might add) suggests things that can't be done in modern Unreal like casting PlayerController to AIController. No I can't provide a link, I closed it out a while ago.
so yeah that's really it, I'm struggling to implement a proper MOBA-like top-down player controller. Any help would be appreciated
Why the upkeep though? Why not just get all players, and at the time of start, get the players with pawns in that area?
GetGameState->GetPlayerArray->Loop->GetPawnPrivate.
If PawnPrivate == OverlappingTheLobby -> Teleport
Then you don't need to save extra arrays or anything. Single function call after the delay.
Seen in what example? For a LoL type experience, I'd use a separate camera actor and not attach camera to pawn
As far as pathing to a point goes, there's a "close enough" radius in the settings somewhere, you can change that.
er, template. figured example was close enough. I started with the Top-Down Template and... it... ehhh...
Find an rts camera tutorial
Yeah you'll have to change a lot but I would not even entertain using an AIController on the players character.
That would solve the camera issue
and having the camera be detached doesn't solve the main problem, in this case being locomotion.
Only would do that for a game with no one pawn representing the player like an RTS or something.
Just skip the rotation part, add constraints to how far it can move in each direction
The basic pathfinding locomotion should have an acceptance radius.
Looked for it, can't find it. Not in the pawn anyway. Maybe it's in an unrelated class, but I haven't been able to find it
I'm trying to do a 'racing game' where you can enter a lobby, your pawn gets deleted, unpossess and then you have to wait others to join
But I'll give your idea a try, thank you
Dig around in the CMC
Ah. Same thing I guess. You could just put a variable directly on the PlayerState marked as "bIsReadyForRace" or something. UI can use the same value. Same loop and you can just compare that bool. Set it when deleting the pawn.
By the way, why I can't get the ControlledPawn from a client's Player Controller on server
Do I need to "somehow" convert it to the server owned playercontrolled if that makes any sense
Checked. It's not there. The top-down template uses a blueprint function named Simple Move To Location, which doesn't even touch the CMC (from what I recall of reading the source code). also I'm using 4.26 if that helps
Then don't use that, use a better one or make your own MoveTo
Not sure. It should work normally.
Hey Guys , noob blueprint question here , you probably have an easy solution: when i use the "on component begin overlap" node it gets triggered a bunch of times when i enter it with my player character instead of only once. i already checked what objects are causing the trigger to fire and its the capsule collider of the player every time. i would hate to use the dirty fix of adding a delay ... any sugestions to get it to fire only once ?
I'm doing it in a Actor Blueprint, not inside the PlayerController
Is it able to get a nice big overlap or are the capsule and trigger barely touching?
Hi , i'm currently using a Pawn blueprint for the door , i would like to reuse it for future doors
@fallow umbra Oh. That would be why. I didn't consider that before. Little slow today. You can't ServerRPC from an actor that the client doesn't own.
Hey, currently you need to stand in the collider for it to fire so i would think there is a decent overlap
I think it should be an Actor and then you can Create Child Blueprint Class
yeahh .. i'm on the verge of doing something like that :p , i was thinking of going overboard and calculating in blueprint when the player leaves the collider , but then i thought, lets ask the guys on UE discord
It might not need to be , i figured since i want it to communicate with the player , it needed to be a pawn , but this might be wrong. eventually i want the player to press a button to interact with the door
Alright , thanks lorash, good to know
Consider having your door as Actor, and use BP interface to communicate between door actor and the player character.
Alright , Thanks guys , making it an actor will probably eliminate some of the overhead useless computing it does now. do you think it will fix the collider firing multiple times though?
hmm ..
collider firing twice probably means it registers two components overlapping individually
yeah , i figured this too , but when checked, the colliding component is the capsule collider of the player each time...
try disabling the collision of other components regardless
i don't know if it works this way too , but when i disable the player capsule collider, nothing else triggers
i got a question witch node do i need if i want a mesh to look at crosshair like for turrets?
Anyhow , thanks for helping out guys , i will make my door an actor and see if the trigger issue still exists, and if it gets solved this way , or if i find another way i'll drop it here for good measure π
well I did say other components
Depends on how you implement the turret. Set World Rotation with Get Rotation From X (if the turret is a bunch of static mesh), or make the animBP fetch the location of the target to rotate the bone around (if it's a skeletal mesh)
its a bunch of static mesh
so what's the target i need the camera or something else?
@inland stone Line trace from center of camera forward, use hit location to get the unit vector from turret to hit location. Use unit vector to determine your turret's new rotation.
like this?
Hit location is in world space, not relative.
Hi there! I'm trying to make an actor rotate back and forth in a specific one-dimensional arc.
I've tried plugging an animator node into both Add- and Set World Rotation nodes, but the rotation is never even (it always rotates more to one side than the other.)
I've tried using a Rotational Movement component, but I'm a little stumped on how to tell it "when you get to X degrees, reverse rotation".
Any ideas on either of these or maybe methods I haven't tried yet?
For context: these need to be rotating back and forth in their own 90 degree arcs.
Which rotation are you using for them? Yaw?
Yeah
GetActorRotation.Yaw + (90 or -90) Use that for the next Yaw set rotation
is there an easier way to set multiple components visible in a blueprint? I want to control what shows, and i have 4 components each with 3 attached components. Am I able to set visible one component and all the components attached to it?
My only other option would be to create a big construction scripts targeting each component and set visible
Thanks, I'll fiddle around with that and see what I come up with!
Ah how did I not know that
Ayyye! okay so i was trying to do this exactly then, i just couldnt figure out casting because it would always go through as failed. Guess i have some required reading rather then my usual "throw it at the wall and see what sticks"
random question, how would one create a system to make something happen when a certain input hasn't been used in X amount of seconds
@bright harborEither tick with a gate, or start a timer from the input pressed, and run an event when the timer finishes.
To understand casting, it's must easier to understand pointers first.
Pointers(The light blue variables that appear as objects) are memory pointers. These are very small variables that are mostly a number. This number points to a location in your memory(RAM for instance). When you create an object, you store this object in memory, and then you also create a pointer variable that points to that memory location. This is so that you can look up this object again later and pass it around to other objects or through functions without actually having to pass the entire object through. Pointers can store the memory locations of any object that is of the pointer type or any class that inherits from that pointer's type.
So you have a class of Apple. This is a child class of Pickupable. Pickupable is a child class of Actor.
So Object->Actor->Pickupable->Apple
When you call a function like lets say LineTraceByChannel. The hitresult struct has a HitActor in it. This is a pointer of the type Actor. This meant that this pointer can validly point to any object that is an actor or inherits from actor in some way. You do a line trace and hit an apple. But the HitResults pass this apple back as an Actor. If your line trace actually hit an apple, you can cast this point of Actor type that is pointing to an apple to Pickupable, or Apple. If you try to cast this to Character for instance it will fail, as Character inherits from Pawn, which inherits from Actor, but Apple has no inheritance to Character and the Actor pointer from the Hit result is an Apple.
The reason for this is memory management. When you have a pointer to something in a class, even if the execution never runs, you need to load up that object before the object that the cast is in can be loaded. So if you pass around everything as Actors, you are not causing extra memory to be loaded in a lot of cases.
@final skiff
I am not sure where to post this really so...I tried binging for this but can't recreate the find :),,how do I add a icon to main menu in ue4...TY anyone ;))
Image widget
Random question. Whatβs the overhead on using variables (both global/local) and functions in blueprints, just for the sake of cleaning up legibility?
you know polymorphism exists in non pointer based languages as well, right?
Cool.
generally, tiny. local variables are zero'd out once outside of scope
What about function calls? I guess Iβm trying to get a better sense of how much I should avoid functions and variables if I were only to choose creating them for the purposes of minimizing BP lines
Protip, function arguments are already local variables, just don't show up in the window. You can have a getter for any of them in the function. No need to save the arguments as local variables.
Overhead in your brain is much more expensive, use whatever lets you keep your sanity. Move the slow shit to c++ if needed later. If it's already in a function, it's way easier to take that step as well.
honestly if you really care about performance that much you'd be much better going to cpp. function calls in and of themselves depend on what's going on inside the function
premature optimization is the root of all evil
Problem: I cant leave crouch aim animation.
Can't see in your video, what's the exit condition for the crouch state?
wdym?
probably better to ask in #animation regardless
my guess would be your anim state transitions aren't setup correctly
animBP is still #animation
Alr
because state transitions are handled through the animation state machine behind the animBP
which brings me full circle to what I said before
You meant that?
Okay I fixed that but now I have some kind of weird animation betwen crouching and crouching aiming animation.
If variables or function calling overhead is a concern for your performance, you may want to consider finding a different target platform. Organization is paramount to any large scaling software. You can always refactor bad areas in places if it's too slow. You can't do that if you never finish it from not being able to follow your code base. Nevermind the potential of having to work with someone else.
@maiden wadi so i should use location instead of hit?
Either will work in most cases with a line trace. They'll be the same point. That only differs with shape traces. My point is that you're setting stuff in local space by changing it's relative rotation. You either need to inverse transform that hit point into the turret's local space to use it like that, or do the math for rotating the turret in world space.
Casting to the player character shouldn't take any extra resources right? Since the player character is always loaded?
It would not, usually, no.
Thanks
For that reason, if you can, cast to your player in the class that needs to know of them on begin play and save it as a var
Casting itself doesn't matter, and getting the local player is a very fast function. Not worth upkeep of another reference in a lot of places.
Only place I'd even consider that is some form of tick function that has to use it often.
another problem i have is that the turret not looking at the crosshair, i got the line trace set up and working but the turret is not looking
casting does have an inherent cost, about the same cost as a branch
Is there any reason why I can't create a subclass of AssetUserData?
@indigo bough It's not Blueprintable marked from what I can see.
Would need your own direct child with the UCLASS marked as Blueprintable to make one.
data assets are cpp only afaik
as in, only workable in cpp. but they can be exposed to BP
I need to set collision on and off for my door triggers. The thing is, when I set collision to Query only, the overlap doesn't trigger. I'm confused because the description for Query says it's for raycasts, sweeps and overlaps
I'm not sure what the UAssetUserData is for exactly, but normal DataAssets are blueprintable by default.
@rose citrusQuery will work for Overlaps and I believe line traces when channel blocks(Needs checking). Physics is required for Hit events if I recall correctly.
I'm going to try to set generate overlap on and off instead of set collision to see if that works
it doesn't work anymore, even if I go back to what I think it was before, confused why it doesn't work now -__-
maybe I'm working with outdated knowledge then. I was going by this video as a reference: https://www.youtube.com/watch?v=gLWXZ3FXhO8
Nah. I just double checked that. I could have sworn the default was blueprintable. Then again come to think of it I've never made a BP only Data Asset. π
Guess it wouldn't be hard to make a basic empty C++ class with it blueprintable, but that requires even having the project C++ capable.
how can I round a Rotator's values? I want something like 54, 160, 20 to turn into 90, 180, 0
make a function that does that for you. there isn't any in by default I wouldn't think
split the rotator into floats and do whatever type of rounding you want on each of the floats
okay, how would i restart the timer if the timer is running and i hit the button again?
like input timer starts input again timer restarts
I've created a very simple time BP. I'm using time of day to determine the suns position, with 1200 being when the sun is at the highest point. The time script works great, though for some reason, the rotation script increments, reaches around 90 degrees rotation, then decrements into the negatives, and the timing is never right. I know I have an offset of 90 degrees, but I haven't even gotten this to work yet. Any clue? Thanks.
@bright harbor When you SetTimerByEvent, you'll get a TimerHandle returned from it. You can use that to see if a timer is running already. If it is, ClearAndInvalidate that timer, then set a new timer.
@pine idol Highly recommend you rotate your object thing by 90 degrees and use Roll or Yaw. Pitch is not a good direction for full 360 degree rotations because it clamps between -90 to 90. So 180 degrees. The reason is that lets say you have a 0,0,0 rotator. You set pitch to 89. This is from 0 which is at horizon level to 89 which is looking nearly straight up. If you add 2 to that pitch, you'll still have 89 pitch, except that your roll and yaw will be inversed, so both will go from 0 to 180. There is a stop gap in a lot of Rotator functions that keeps smaller numbers from causing rotation from doing this and will just clamp pitch at 90 or -90 without inversing the other two values.
TLDR:: Rotators are meant for FPS character movement largely. They handle pitch in only 180 degrees without extra math. Using Yaw or Roll for full 360 degree rotations is much easier.
I've got a panel grid of hearts as my health, and after establishing them I set a bool to be true.
and the if branch will only do the for each loop if that bool is false.
But everytime I refresh my HUD, it still fires through the the branch as if it was false, despite it being true, because my print string confirms it. I've never come across ue4 ignoring bools... has anyone got any ideas?
Edit, its now ignoring DoOnce
Print string on your bool to verify if its true or false at that point
Does it continue firing or does the loop run its course
I believe as soon as you hit the loop it will finish
So it will run through the entire loop once no matter if the bool is still true
it runs through the loop body, going through a false branch even when its true as well as a DoOnce node
that makes so much sense.. thank you
Hmmm I don't know I'd break the connections refresh nodes attach again an compile
Otherwise it's above my skill
Lol
Sorry
Alright I'll try that, thanks anyway π
are you by any chance recreating the HUD somewhere during this?
Yes, I have a refresh event on my player. It removes from parent and recreates it, I do think thats the problem, but I don't know another way to refresh a widget, so I'm trying to carry over an array with the amount of hearts it needs to recreat instead
I must say, I am really starting to enjoy the blueprint system (I initially did singleplayer mechanics and then decided to try make them multiplayer mechanics because why not XD)
Now I've colour-coded the stuff so when I come back to this blueprint I know exactly what I am looking for. (Cyan = Server Actions, White = Client Action, Purple = Client Request to Server)
God I am loving this too much XD
if you recreate the hud it'll start with default values... so the bool will be false, no?
This will teach you how to update your widget with blueprint communication
You dont want to recreate your widget, instead you want to update the values whenever they change
So if health changes, it will start an event in the widget that will update
Thanks! I'll take a look
Is there any way to take an rgb color map and turn them into clickable regions on the landscape? I'm trying to make an interactable map with provinces (like in a grand strategy game) but can't find any solution. I can't even figure out how to reference a texture file in a blueprint
the example here is the rgb color map that I want to map clickable regions to
there is probably a way. is there a way in BP? unlikely
I've tried your solution, however, it seems that the sun directional light only responds to Pitch Modifications?
Changing Yaw and Roll and no affect
Rather, they had an effect, but the sun only moved across the horizon, but never into the sky.
the directional light is a special case
and pitch is necessary rotation for some elements
just bear in mind that it gimbal locks at +/-180
yes, that's the problem i'm trying to solve atm
use quaternions
You can search on redblobgames.com for useful links. Voronoi or a pathfinding-algorithm to create the regions and an array of points to colorize. Voronoi has some other advantages with midpoint displacement for borders, roads, mountains, rivers,...
Hey all!
My Lookat is -135, my Theta is 90, so why are both addition and subtraction nodes returning -135 as an answer?
Theta must register as 0
Refresh nodes and compile again
Or its set as 0 somewhere
Also don't explicitly trust the BP editor like that. It has a lot of quirks to showing wrong values at times. Prints are much more reliable. So is a breakpoint node AFTER the node calling the pure nodes.
I'd like to display a button prompt dynamically based on the key that an Action is mapped to. Is there a native way to do this?
I thought of this approach:
but this would require the user to press the key once
is there no node that allow me to get the currently set keys from the project settings?
spawn the hud widget on begin play, create a function that takes a key parameter, use the function with the input action
isn't that literally what I did there?
not at all
how do I get the "input action"?
... you have it
I have no way to pass it around afaik
well with what node could I access the action?
I get that part but I can't figure out how to pass in the input action as an argument.
there's no "GetInputActionKey" node AFAIK etc.
I need to know the key BEFORE the user presses it.
that text you see there.
I want it to dynamically change the "press Enter" portion of it to e.g. "press Backspace" depending on what has been set for that input action as its key inside the project settings.
I was hoping I could access the Action Mappings in Blueprints by their name, e.g. ServerGeneralAction and get the Key object for that.
you can
@odd ember
but none of that will help you with you current situation
reread what I said
and do that
and you can do what you want to do
then I'm misunderstanding what you're saying completely.
so I can't
if this is the case how would the approach you outlined a second ago work then?
I need to know it without the user pressing the button.
I'm confused.
spawn the hud widget on begin play, create a function that takes a key parameter, use the function with the input action
I already spawn the hud widget on begin play and pass the key parameter of the input action to it. Whether I do it using a separate function doesn't change anything about it...
and yes it does make a difference
you can call a function any time
you can't call beginplay any time
I have a cpp timer event. And a child blueprint which sees the event.
How can I receive the event with any actor blueprint?
unless the child blueprint is globally accessible you cant
Can I make the childblueprint globally accessible?
@odd ember like this it works even though I set the key at widget creation time, which in my understand does not make a difference at all
the only missing puzzle piece is in how to get the Key of an Input Action without having the user press anything
InputAction ServerGeneralAction was pruned because its Exec pin is not connected, the connected value is not available and will instead be read as default
your logic is set up to use it. but the key will never change because you only set it on spawn
yeah trying it rn
If my cpp file extends AActor Should any actor in-game be able to see the event?
I think you're missing the fundamentals of what a generic function is or how it is used compared to something like beginplay
@odd ember that's not it. There's just really no use in using a function for this at all.
also my solution works perfectly fine.
although it's a bit clunky ngl
anyways thanks for your help! @odd ember
I also get what you were referring to lmao. you were talking about a Binding function. I already had that and just moved the snippet over that I just made.
again, that wasn't where my pain point lied. I literally didn't know about the Get Action Mapping by Name node which was my only problem.
no you can spawn the HUD and then have a function do it normally. but I guess I misunderstood what you wanted to do. still, your case only handles the first player case. but I guess in terms of server that's OK
bindings are only relevant for callbacks
yeah this stuff is really just for the server and a one-off thing kinda
sorry Binding is the wrong term. I meant this by that:
a Bind function I guess?
it's the same thing. it's not what I was referring to.
hey quick question ... when is there much if any of a performance difference between say 1000 cubes placed in designtime vs 1000cube spawned at runtime?
i'm doing a cad/builder type game but i want to export and import a human readable csv file with all the objects for processing in another application i'm writing
it's whether the load happens as the level loads or when the cubes are spawned
up to you
after the level loads, but the level is just one huge textureless plain
@mint mica As for spawning them, nothing really. That'll take up mostly the same time to create the objects. The major difference is that supposedly meshes spawned from the level are auto optimized. So the only difference would potentially be runtime framerate after the spawning is complete.
does ue still avoid rendering them based on distance?
the runtime created ones i mean
probably not googling for the right thing lol
sure if they are very far away and very small. you can lod them too. otherwise UE handles occlusion culling as well
but I'm not sure what your issue is really
1k cubes in an empty map shouldn't be a massive undertaking
i think i've found what i was looking for using the wrong term should have been looking for culling distance
only actors that derive from your subclass
I figured out what my problem is: while my Level Blueprint is doing all the right math, it's not setting the variables in the actors.
Oddly enough, it will set their rotation and such, but not Theta, Number of Players, and the like.
any reason you're doing the logic in the level blueprint?
Thanks for this insight. It's how I figured out my LevelBP isn't setting the variables in the actor BPs
Just that it only needs to be done once.
is it specific to the level?
Hi, I have a question :
I created a Main Menu being at the same time, the menu you can open ingame by pressing Escape. I'm using a FlipFlop node, so when I press Escape once it opens the menu, and press it again it closes the menu. It works perfectly but I added in the menu when you're in game the button "Play" being transformed into "Resume" as "Play" opens a Level in the MainMenu but made it come back to the game it self (Resume).
The thing is if i press Escape once, the Flip Flop is on A, but if I press the Resume Button it goes to the game as intended but FlipFlop doesn't go to B, so next time I have to press Escape twice to make the menu appear. So is there a way to change the Flip Flop value each time the player pressed Resume please ?
use a branch instead that checks if your main menu is valid
Eeeeh, I hadn't really planned on having more than one level (this is more of a simulation than a game) but that's a fair point.
I'm already building a Level Manager actor to keep track of everything that's happening, update the HUD, etc.
No reason I couldn't just copypasta the setup over to the manager actor.
Why would I check if it's valid as I don't really destroy my main menu I just Add it to viewport or Remove from Parent
I mean usually you'd have the logic be calculated inside the actors themselves. level BP is fine if it's specific to the level. but outside of that the use cases are fringe
well then check if it's visible or not. the point being that you cannot reset a flipflop like you want. so the next best thing is to make something you can reset
aright thank you
Just for context: everything in this picture is spawned and calibrated on BeginPlay, including the "cannons" specifically being procedurally placed, colored, rotated, and told what their sweep arc is.
I figured it would just be easier to have a single actor that calculates Theta, calculates the cannon positions/moves them, etc.
is there a way to check if the code is running in the editor? there's nothing called like IsEditor
I believe there's something called IsPIE
or if not, it exists in cpp and you can expose it
... why aren't the cannons themselves instances that calculate their own data each?
So the idea was to do some future-proofing and set things up in the event that I wanted to use a different number of cannons.
This method lets me use any number of cannons and they'll all be perfectly even-spaced around the center of the arena.
Is there a better implementation I missed?
well if each cannon carries their own logic, you could still have an infinite amount of cannons?
it also neatly encapsulates the data
generally you want things to be responsible for their own logic
Most definitely, but I'm not sure how I would place them.
as in, spawning them?
Yus
I imagine this would be some player controller action or so. but I don't know the details of your implementation
having a manager class is not bad per se, but it usually involves elements that are beyond the scope of a single managed class. for instance, formation between multiple soldiers
So, the question is, how do the individual cannons know what their spawn coordinates should be?
and each class is still responsible for their own individual actions
the manager just handles the "group" actions
internally they can just use GetActorLocation
I mean: they can't spawn if they don't know what the spawn Location coordinates are. If they're spawning individually, how do they know the correct coordinates to produce evenly spaced contestants?
well you use spawn coordinates on the spawn node
for obvious reasons the actor can't spawn itself
Is there a way to limit the range on where the linetrace will fire based on the distance to the player? I would only know how to, if my start is the mesh itself and so I get a look at rotation and the forward vector of that would be the distance I want to get - but If my start point is somewhere in the Sky for the TopDown Template of Ue4 Im stuck atm
show your code
what's inside those macros?
This might clear things up: I'm trying to replicate this.
This idea is partly inspired by @Carson Jay Marbles 's Territory Wars.
Check it out here: https://www.youtube.com/watch?v=LOOflhF1Bjk
Who will win?
[Marbles]
1.Red
2.Yellow
3.Lime
4.Blue
[App]
Algodoo
http://www.algodoo.com/
[Music]
Track: Uplink & Jason Gewalt - Euphoria [NCS Release]
Music provided by NoCopyrightSounds.
Watch: http...
I don't see anything egregious here.
I don't even see the turrets being placed
and the other macro?
its the same, im just not using the z value of it
Yeah, neither do I, which is why I'm not super worried about efficiency.
And no, I suppose you don't. Like I said, it could always be done manually, I just wanted to save myself trouble in the future if I wanted to do a 3, 8, or 24 cannon match.
I mean I don't think I was being clear then: I don't see why the turrets shouldn't contain their own logic
Yeah, I'm refactoring now to see how I can improve things.
the location from the first macro should be good enough to get you what you want. you can also combine the results so you get the xy from the cursor and the z from the player for instance
but yeah, your approach of look at rotation I've used as well for the same
(and it's worked)
ehh
maybe im reading it wrong, how is that helping me to tell if the capsule collision is inside the linetrace?
im basically trying to tell, is that capsule collision in the minimum distance to player I set - which would be the linetrace to vizualise it
the capsule collision of the player character?
no of the new one I create on mouseclick
I tried comparing both hit locations, but no good result :/
oh sorry its a sphere not a capsule
so you want to know if the sphere is inside a radius of the player character, yes?
or am I misreading it?
yes
Does anyone know how to actually setup ControlRotation when you're locking the camera to HMD (vr headset)?
oh im dumb I should just compare the new hit location and the mesh in the context of distance...
yeah basically compared squared distance with squared max radius
I had to actually find the code I did
How can I make 2 movable actors move like one ? I have them parent child but they do not move as one.
thanks, have it working now π
how do i create an image
in construct
using a node
one of these things
also how to create spacers
not sure if that's possible in BP. but you can try construct widget
has anyone seen this with state machine debugging in 4.27? It's like getting stuck and not updating correctly, happens in all my 4.27 projects
pretty sure it's SetBrush on the image widget, split the Brush struct, and then add your texture/material
what are your transition checks? (unsure of proper name)
between inair and land
Transition Rules? They are fine and working it's just not displaying the debug info correctly
also looks like you got two going from land to grounded
oh
debugging those I haven't learned yet xD
it's supposed to show the percentage updating as it transitions but they are just stuck on 100% / 1% or whatever
Are "being destroyed" and "pending kill" interchangeable for decals, or do they mean different things?
no
i need to create an image
not set a texture on one
oh, uh, lemme check
alr tell me if u find one but imma just go and make an array tower as a hacky replacement
isn't there a "get childeren of widget" method?
still waiting for my code to compile so unreal starts xD
I guess what you could/should do is make a custom widget that has an image, then make that custom widget in a loop
you're better off asking in #animation
Flying metahumans?
Also #instructions
my build is crashing with no warning, exception is 0xC0000005 The thread tried to read from or write to a virtual address for which it does not have the appropriate access. I'm new when it comes to debugging this kind of thing, anyone know how to fix this?
If you set members of a struct like so:
do you have to do something with the resultant struct to save it? or is it already saved into the original target struct?
Depends on the input
the character is a character which is null and the row/column are ints which are 0 before this point
then im spawning an actor which returns a character and im feeding it along with the ints into this set members node
doesn't seem like its saving
as long as the struct ref is a pointer to the struct you're trying to change it should work
I'm going to guess a for each loop isn't giving me a reference to the array element then
it's giving me a copy possibly?
for each loop gives a copy
is there a way to do a loop where it does give a reference
you can make your own for each loop.. or just get the array index and use that to get ref
interesting, both seem valid. Thanks
that worked. also learned how to pass values by reference into functions. fun stuff
Hmm. working on a different function now. is it not possible to return something by reference from a function?
The little arrow i expanded before on the function input to select pass-by-reference doesn't exist for the output
guess i can test and see if it actually is passing by reference anyway
it's definitely not passing it back out as reference
apparently it can't be done unless you wrap the struct in an object that gets passed around by reference automatically
a macro might also work? gonna have to look up a video on that
how can I change movement speed inside a behavior tree task?
this obviously doesnt work since its a pawn that goes in, and they dont have movement components
(thats what the error says when u try to turn context sensitivity off and set movement speed)
when i do "Get Movement Base Actor" instead of the one you're using it looks like it has all the speed nodes in its context
nvm im dumb i had the context check off
try off player character "Get Character Movement" that one definitely has the speed nodes this time
haha, happens
yea especially when you don't work with ai systems much at all, but I'm trynna get it down more
making an ecosystem project I may turn into a survival game, where its a forest and animals roam around and eat, hunt and what not
oh, also, one more thing if you know, is that a good way to do that? I have that task that takes in the walk speed and when an animal is spooked it sets its max walk speed, then does my get random location task, then moves to, then resets it back to what it was.
edit: I'm also pretty new, and doing it in behavior trees is already a huge step up optimization wise for me
sounds good to me. I haven't worked with the ai system much outside of dialogue trees. but it sounds fine.
I'm also quite new myself
yea, im on the brink of like c++ stuff, I can do basically anything in blueprints, but the optimization, and ready for an actual game quality is not there, so I gotta work on that stuff and figure out more optimized ways of doing a lot of things
but whatever you do, don't follow along with Matt Aspland youtube tutorials, when I was starting out I did, then I thought stuff didn't look right and went to his comments and in almost every video they complain about stuff he does, and explain easier, quick to do, simple fixes
hey guys in sorry to butt in, but id like to know how i can make a dropdown window to find live link subject on a main menu type widget. So that you can select the subject before you switch to another level that way the character is updated with the new live link subject incase other people want to connect their phones. Is this possible?
*Quietly walks away, since things are getting above and beyond me*
but take care, will prbably be back with another question in an hour or so
how do i add tag using blueprint
Get the tags array, add to it
Any idea why my timeline isn't updating properly (UE5)? It only outputs zero
This blueprint is an AActor
The timeline is triggered every 1-5 seconds. The second keyframe is set to -30 the float output is wired into the Vec3f and then set relative location which moves a cube mesh.
@worthy rock dunno. Just have to debug it. How frequently is it being called? Is the play rate set to 1? Etc
Is your game paused and/or time-dilated?
I did not set the play rate. Setting it didn't appear to effect anything (Does it have to be set in the construction script?).
I hit play in engine. The time-dilated box is not checked...
I have another BP running off the same event. It just swaps visibility for a different object on and off. And that one runs fine. So it's not due to it being paused.
Is the exec connected when testing ? π
exec?
hey guys i have a question
I have a pawn wich has a collision sphere and a skeletal mesh attached to it.
I need the collision of the skeletal mesh to be taken into account when the pawn is colliding with world static but it doesn't seem to work.
What am I doing wrong?
It is. I dunno why I messed up my screenshot lol
The object does move.
It's just very very fast. And appears to only output zero.
So if I hook the output float into the X coordinate, the object moves to X=0.
Show me hownits connected properly lol
Show me the bp graph
Whats its default relative location?