#blueprint

402296 messages Β· Page 793 of 403

gentle urchin
#

Clever head

lucid ingot
#

you understand what i am saying ill try that out

gentle urchin
#

Id also consider some ik for pointing the gun correctly but idk if that would work properly

maiden wadi
#

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.

lucid ingot
#

this is exactly what i was thinking

maiden wadi
#

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.

lucid ingot
#

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

gentle urchin
#

Is this purely fps?

#

Or tps?

#

Sentence was unclear

lucid ingot
#

Yeah + like spawnable turrets, drones, barbed wire

#

FPS

gentle urchin
#

Ah

#

So hit location is not an issue then

lucid ingot
#

hit location is on point

gentle urchin
#

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

lucid ingot
#

and turned 45 degrees

#

yeah

#

im going to try your method, and see what i can come up with @maiden wadi

#

thank you bud

gentle urchin
#

Authaer's method, ye ^^

lucid ingot
#

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?

glad compass
#

how can I remove a child mesh's parent without deleting the mesh?

#

I essentially want the child mesh to become its own object

glad compass
lucid ingot
#

Yes.

#

remove that mesh

maiden wadi
#

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.

lucid ingot
#

and it becomes blank

lucid ingot
formal wren
#

Hi, changing an existing structure crashes my editor. Anyone has a fix? I am on 4.26.

odd ember
#

changing how

formal wren
#

Doesn't matter. Rename variable, add new variable, remove variable...

odd ember
#

is it in use anywhere?

formal wren
#

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.

gentle urchin
#

Sounds healthy. Consider a cpp struct instead :)

formal wren
#

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

harsh kayak
#

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.

tidal marlin
#

Hello.
Whoever has faced this problem?
Widget no see.

solid sandal
#

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

velvet forum
#

Hello , when i call actor from variable it give me error

#

how can ifix this or call variables

solid sandal
#

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

gentle urchin
#

If its a known baseclass, surely the pins can be exposed?

#

E.g. bp_master_weapon class?

faint pasture
faint pasture
gentle urchin
#

First mistake then imo

faint pasture
#

@velvet forum Show the Ammo Actor variable type

proper vale
faint pasture
clear warren
#

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 πŸ˜„

desert juniper
#

@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

odd ember
#

good that you found a way. I'd still not recommend doing it that way, but it's up to you

desert juniper
#

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

maiden wadi
#

I personally started following epic's example of that. Just easier with two meshes.

odd ember
desert juniper
#

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

odd ember
#

welp @maiden wadi I blame this squarely on you πŸ˜‰

desert juniper
#

lmao it was like a year ago. can completely understand that opinions and workflows change

odd ember
#

I keed

maiden wadi
#

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.

odd ember
#

not to mention any sort of performance optimizations would be easier with two meshes rather than one

desert juniper
#

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

rose citrus
#

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.

desert juniper
#

you can use that to check against the specific mesh you are trying to detect

cobalt bluff
#

Hey, is there a way to eject and possess in blueprints?

rose citrus
#

oh let me try that

velvet forum
faint pasture
#

@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

desert juniper
faint pasture
#

He has but I don't think Ammo Actor is of type BaseAmmo class, it's probably just a straight up actor class

desert juniper
#

ah I see

odd ember
#

you were right

faint pasture
#

@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

gentle urchin
#

Well guessed Adriel

odd ember
#

a round of applause

#

πŸ‘

cobalt bluff
#

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?

odd ember
#

well... not quite

#

but kind of

#

possess a spectator pawn

cobalt bluff
#

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

odd ember
#

you can always make a keybinding that has the specific rule of toggling between spectator pawn possession and real pawn possession

cobalt bluff
#

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

odd ember
#

welp, time for #cpp then

#

I'm not really sure what you want though

swift sphinx
#

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

#

you'll need spacing as well, presumably

swift sphinx
#

@odd ember yes

odd ember
#

cool, you, should have everything you need then

swift sphinx
#

well all except i dont know how to set it up

odd ember
#

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

knotty pebble
#

how do I connect a Texture 2D pin to an Image one?

odd ember
#

can you show your logic?

knotty pebble
#

I probably need to make a brush from texture I guess, but still don't know how to continue from there

odd ember
#

yeah you do

#

texture to material, material to brush, brush to image

knotty pebble
#

do I need a material? it's just a 2D UI icon

odd ember
#

generally everything is handled through materials

#

even UI

knotty pebble
#

alright thanks, but I can't see how to get the image from the slate brush

maiden wadi
#

@knotty pebble Are you trying to display a simple icon from a Texture2D? Not entirely clear on what you're after.

regal elm
#

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

odd ember
knotty pebble
odd ember
#

and you can't use a material because...?

maiden wadi
#

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.

split orbit
#

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?

maiden wadi
#

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?

split orbit
#

They level up independently

Yes

gentle urchin
#

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 ?

split orbit
#

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

gentle urchin
#

No overflow xp?

split orbit
#

Yeah if theres overflow it carries over

gentle urchin
#

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?

maiden wadi
#

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.

gentle urchin
#

^ true. It would be 2 variables , one for ability xp and one for level xp in my proposition

split orbit
#

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

waxen sorrel
#

Got a box with this render properties gone in the cameras rendering but visible on viewport any ideas ?

maiden wadi
#

Then yeah. Each thing that levels needs it's own XP value.

split orbit
maiden wadi
#

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.

split orbit
#

Yeah, the leveling system I have is extremely complicated XD

waxen sorrel
#

Turns out the purpose of this is to don't cook on final build

#

but don't render the actors in editor Vibing_Cat

gentle urchin
knotty pebble
formal dagger
#

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

bright sleet
#

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

earnest tangle
#

This depends entirely on what the species does

indigo bough
#

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.

icy dragon
bright sleet
#

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

bright sleet
#

But I wasn't sure if I would extend it further and have different classes for the different species

maiden wadi
#

@indigo bough Not without setting it. You can probably do it in the construction script.

icy dragon
indigo bough
bright sleet
maiden wadi
indigo bough
#

Yeah, this is all in the same actor

maiden wadi
#

If you know which index, all you have to do is set the struct parameter directly.

indigo bough
#

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.

bright sleet
maiden wadi
#

Fun days. πŸ˜„

indigo bough
#

Something like this:

rose citrus
#

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

maiden wadi
#

@rose citrusPretty sure this works. Have not tested myself.

#

If you need an actual event, there is an AnyKey input event.

rose citrus
#

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

maiden wadi
#

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.

rose citrus
#

yea you're right. Thanks!

tiny vale
#

any idea why i cant set a custom component as a parent class?

icy dragon
gentle urchin
#

Im using a c++ component class as parent (reparented, as you're trying to) with no issue

gentle urchin
#

Whats the parent class of your component ?

icy dragon
tiny vale
icy dragon
odd ember
#

this is some #cpp stuff

whole roost
#

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

maiden wadi
#

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.

whole roost
#

not the thing i was talking about, thats just compressing it

#

kinda inventory style im going for

maiden wadi
#

The X part just needs to be not sized. Remove any sizeboxes or whatever that control Y size or height.

earnest flax
#

hey guys could someone please help

#

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 ...

β–Ά Play video
#

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

maiden wadi
#

Right click the blue OutHit pin and Split Struct.

earnest flax
#

ohhh, thank you

maiden wadi
#

A Struct is a container of properties. OutHit is a struct. You can access them by calling Break or by splitting the struct.

earnest flax
#

ahhh I see

#

thanks

bright harbor
#

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

bright harbor
faint pasture
brazen merlin
bright harbor
brazen merlin
#

tippy top component thing

bright harbor
#

OHHHH i got it, tysm

#

what’s the setting called just to be sure

brazen merlin
#

Jump Max Hold Time

#

and Jump Max Count

lament ginkgo
#

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'?

bright harbor
clear warren
#

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

maiden wadi
#

@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;
}
lament ginkgo
#

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.

maiden wadi
#

What is this using? What are your input events?

lament ginkgo
#

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

maiden wadi
#

Ah. πŸ˜„ Yeah. I handle input a little differently. Have like three keys for holding to rotate camera.

lament ginkgo
#

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.

mild jacinth
#

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

icy dragon
mild jacinth
icy dragon
#

Blame Jensen Huang and his leather jacket lmao

#

I have yet to see reports of similar issue from AMD users.

final skiff
#

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

final skiff
#

i just need to start up the game and the text not be visible

brazen merlin
#

Please do not cross post unless directed

torn kettleBOT
#

:triangular_flag_on_post: arakrates#0968 received strike 1. As a result, they were muted for 10 minutes.

sly ibex
#

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

proper umbra
#

Does anyone know why the navmesh wont show up? Pressing P won't show the green layer.

last abyss
# final skiff can anyone explain why i can't get this text to be visible on start? i have the ...

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

unique yoke
#

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.

inland stone
#

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

tired cypress
unique yoke
#

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).

tired cypress
#

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.

unique yoke
#

Okay, thanks Khade!

gentle urchin
#

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

unique yoke
#

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.

gentle urchin
#

You could also leave the implementation to the owner but that defeats the use of a component

proper umbra
# last abyss does the mesh have collision

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

ornate linden
#

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.

brazen merlin
proper umbra
#

ohh

#

it should be. It's the default cube

#

i can check tho

brazen merlin
ornate linden
#

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?

brazen merlin
#

i think construction scripts run during editor, but i dunno, never use em, they are editor-side afaik

ornate linden
#

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

brazen merlin
#

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

prisma snow
#

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

last abyss
#

clamp

prisma snow
#

I forgot its name

ornate linden
#

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

visual vigil
#

Any1 knows how to switch to camera on enemy char. Tried set view target with blend but its not working

ornate linden
#

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?

visual vigil
ornate linden
#

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

visual vigil
#

i am asking about switching cmaera from one to another

last abyss
ornate linden
# last abyss 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?

last abyss
#

tags would work yeah

ornate linden
#

interesting, i'll have to switch to that

#

thanks for the heads up

formal wren
#

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

visual vigil
#

Any1 knows why set view target with blend not working when i try to switch to camera on AI character

last abyss
#

what happens when you switch

visual vigil
#

it goes to cmaera on my player isntead of enemy camera

formal wren
#

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

last abyss
#

can you show the code of where ur setting view target with blend

visual vigil
formal wren
#

Got it fixed. Moved the instancing to a more appropriate place

gentle urchin
ornate linden
gentle urchin
#

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

ornate linden
gentle urchin
#

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

ornate linden
#

I'll likely be needing a good amount of that. haha

ornate linden
gentle urchin
#

Looks like tiles is a struct

ornate linden
#

yeah it is

gentle urchin
#

Danger danger :p

ornate linden
#

lol

gentle urchin
#

Make it a cpp struct and watch all problems fade into nothing

ornate linden
#

are bp structs bugged or something?

crisp lance
#

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)

gentle urchin
#

If the last array was named the same you could have issues behind the scenes aswell

gentle urchin
ornate linden
# gentle urchin 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?

last abyss
# visual vigil

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

gentle urchin
#

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)

ornate linden
#

will definitely end up being a deep dive when i decide to swap haha

timber knoll
#

Well not many, rider is often used as an IDE

#

Or VS + Visual Assist

#

Personally I’ve had little issues since using VS2022

ornate linden
#

sounds promising

timber knoll
#

But it’s still fairly slow compared to blueprints

#

Give it 1-3 seconds to load upon opening a file (before you have intellisense)

visual vigil
ornate linden
#

so the opening of the file before you have instellisense is the wait, but actually using intellisense is speedy enough?

gentle urchin
#

Once its up to date its fine

#

Its smart suggestions isnt top notch imo tho

#

Atleast not for meta specifiers

timber knoll
#

Hmmm yeah, I’m just over time becoming more and more independent from all the help πŸ˜…

#

You get used to it haha

gentle urchin
#

Yeah thats what i figured aswell, so not bothered trying any other extension πŸ˜‚

#

Or rider for that matter

timber knoll
#

People also complain about compile time often...

#

Altho I haven’t had any issues myself

gentle urchin
#

Its sluggish

#

My project is tiny and yet theres like 30 seconds to compile

#

Which isnt bad in itself, but when learning its horrible

timber knoll
#

Hmmm yeah I’ve yet to try compile on my laptop

gentle urchin
#

"Was it this way"
....wait 30 sec...
"Or this way..."
..wait 30 sec..
"Or maybe this was how!"
...wait 30 sec...

timber knoll
#

I will have to in a couple weeks πŸ™ˆ

#

I remember building from source taking 4x as long haha

gentle urchin
#

🀣 ouf

timber knoll
#

Anyway, enough on the C++ side we should get back on topic πŸ™ƒ

gentle urchin
#

Yy

quick kettle
#

hi, how to draw the motion track of an object after "setLocation"?

visual vigil
leaden goblet
#

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

umbral herald
#

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? πŸ™‚

icy dragon
spice lynx
zealous fog
#

Recompiling should be slow the first time after that but then quick again later

gentle urchin
#

Say whaat? Really?

zealous fog
#

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

maiden wadi
#

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.

gentle urchin
#

It would require one object per player in that case

#

Ouch

somber panther
willow phoenix
#

what is the difference between function & macro on blueprint? i 'never' used macros because everything works fine with functions. can someone explain? πŸ˜„

zealous fog
#

Functions can only have 1 execution output

#

Can not have latent functionality (such as delay)

somber panther
zealous fog
#

But a function is only compiled once, while macros need to be fully compiled whenever you place one (iirc)

maiden wadi
#

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.

zealous fog
#

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

maiden wadi
#

@somber panther Not sure if you had a question?

somber panther
trim matrix
#

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.

native willow
trim matrix
#

Is there any way we can tell epic guys to work on it😁😁😁??

native willow
#

its been removed from ue5

#

so they abandoned it

trim matrix
#

Okay got it.Thanks for info

native willow
#

also in android? wdym?

trim matrix
#

What do you mean by translate itt yourself @icy dragon

#

What is wdym?? @native willow

native willow
#

wdym by "in android"

#

what do you mean

icy dragon
trim matrix
#

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

faint pasture
native willow
native willow
#

disable this ***

trim matrix
#

Got it.Thank you guys.

native willow
#

its the same as hot reload, will never work

#

and will only break your project without a way to recover

#

(not kidding)

icy dragon
leaden goblet
#

can i make it not visible through walls?

icy dragon
leaden goblet
#

if yes, then im home

icy dragon
trim matrix
#

Okay.

leaden goblet
faint pasture
icy dragon
leaden goblet
leaden goblet
#

becasue that will be enough for me

#

i just want to rotate widget towards players camera, and screen space is rotated automatically

native willow
#

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

native willow
native willow
trim matrix
#

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??.

icy dragon
trim matrix
#

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??

icy dragon
trim matrix
#

Okay got it.

crisp lance
#

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?

gloomy linden
#

IsValid

maiden wadi
#

@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.

crisp lance
maiden wadi
#

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.

trim matrix
#

@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

crisp lance
maiden wadi
#

Interface isn't the answer for that. You just IsValid it like Remco said. Pretty common use case.

queen urchin
#

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?

gloomy linden
#

use a material instance, add a alpha, lerp from blueprint to adjust the alpha between 0 and 1

trim matrix
#

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

gentle urchin
#

Is the random location booo true?

#

And out from the aimiveto, does it say it completed, failed? Debug with print strings

trim matrix
gentle urchin
#

So it fails to find a location :)

trim matrix
#

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

gentle urchin
#

You gotta soove the nav issue

#

Solve*

#

Sounds like its spawned outside the navmesh

trim matrix
#

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

gentle urchin
#

All i know is that it fails to find a location,

#

So theres no path from the ai to whereever

trim matrix
#

ok , thx for helping i will see if i can find the buggy

#

✌️

lost solstice
#

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?

gentle urchin
#

Yes you can cast it to its type and access its type specific functionality from thete

lost solstice
#

ahh ok cool. Thanks !

trim matrix
#

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

maiden wadi
#

@trim matrix You can either GetActorOfClass it, or store that target point somewhere like GameState or some AI specific manager.

trim matrix
maiden wadi
trim matrix
#

could i eventually get reference to that target point in there?

maiden wadi
#

Do you have more than one target point in the level?

trim matrix
#

for now only one

#

but i think i will add more at some point

maiden wadi
#

Then lets consider that. If you add more, what would your selection parameters be for which target point is the correct one?

crisp lance
trim matrix
maiden wadi
#

How would you prefer to select which ones are in which order, just an array of target points?

trim matrix
#

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

glad compass
#

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.

maiden wadi
#

@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.

glad compass
# maiden wadi

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

maiden wadi
#

Spawn each one how? Like set the mesh, or create new static mesh components?

glad compass
#

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

maiden wadi
#

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?

glad compass
#

ah, I want to do that

glad compass
#

I want to seperate them

maiden wadi
#

And this is from one actor that already has four static meshes?

trim matrix
maiden wadi
#

@glad compassI would assume something similar to this.

trim matrix
#

just for testing i did something like this

glad compass
#

I think I got it

trim matrix
lyric fractal
#

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.

maiden wadi
#

@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.

glad compass
#

maybe Set Collision Response to Channel?

trim matrix
exotic aspen
#

why is a widget being created and displayed when starting a level, but there is no code or blueprint to actually do that?

gentle urchin
#

There must be

exotic aspen
#

not in level blueprint or character, and no other widgets load on startup so not from them

maiden wadi
#

@glad compassIf you want the same as the BlockAllDynamic setting, you can just set these three like this.

glad compass
#

I fixed it

#

I found out a solution

#

thanks for your help[

#

I really appreciate it

maiden wadi
#

@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.

exotic aspen
#

another thing, any ideas how to stop d3d device loss crash every 2 seconds?

maiden wadi
#

@exotic aspen Laptop?

exotic aspen
#

no

maiden wadi
#

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.

queen urchin
maiden wadi
#

Would start by ditching any third party "optimization" software you might have.

exotic aspen
#

ok

exotic aspen
#

ive looked through everything and there is still nowhere the widget is being created

trim matrix
#

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?

maiden wadi
#

@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.

faint pasture
fallow umbra
#

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)

coral flint
#

Try passing and using the player ID instead

fallow umbra
#

Player ID as in Get Player Controller ID? (im very new to unreal)

coral flint
#

I believe so

maiden wadi
#

Don't rely on IDs in networking.

fallow umbra
#

That's what I'm trying to do, but as I said, clients GetControlledPawn always returns None sadBonk

#

My goal is to teleport all of them to a location after some Delay (so others can join in the that time-window)

coral flint
#

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

maiden wadi
#

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.

faint pasture
#

As far as pathing to a point goes, there's a "close enough" radius in the settings somewhere, you can change that.

coral flint
gentle urchin
#

Find an rts camera tutorial

faint pasture
#

Yeah you'll have to change a lot but I would not even entertain using an AIController on the players character.

gentle urchin
#

That would solve the camera issue

coral flint
#

and having the camera be detached doesn't solve the main problem, in this case being locomotion.

faint pasture
#

Only would do that for a game with no one pawn representing the player like an RTS or something.

gentle urchin
#

Just skip the rotation part, add constraints to how far it can move in each direction

faint pasture
coral flint
#

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

fallow umbra
maiden wadi
fallow umbra
#

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

coral flint
# faint pasture Dig around in the CMC

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

faint pasture
#

Then don't use that, use a better one or make your own MoveTo

maiden wadi
gusty pumice
#

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 ?

fallow umbra
faint pasture
gusty pumice
maiden wadi
#

@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.

gusty pumice
fallow umbra
gusty pumice
#

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

icy dragon
#

Who knows if you can play as a door πŸ˜›

#

The Misadventures of Door-chan

gusty pumice
#

Alright , thanks lorash, good to know

icy dragon
gusty pumice
#

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 ..

odd ember
#

collider firing twice probably means it registers two components overlapping individually

gusty pumice
odd ember
#

try disabling the collision of other components regardless

gusty pumice
#

i don't know if it works this way too , but when i disable the player capsule collider, nothing else triggers

inland stone
#

i got a question witch node do i need if i want a mesh to look at crosshair like for turrets?

gusty pumice
#

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 πŸ˜‰

icy dragon
inland stone
#

its a bunch of static mesh

#

so what's the target i need the camera or something else?

maiden wadi
#

@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.

inland stone
#

like this?

maiden wadi
#

Hit location is in world space, not relative.

rich granite
#

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.

maiden wadi
#

Which rotation are you using for them? Yaw?

rich granite
#

Yeah

maiden wadi
#

GetActorRotation.Yaw + (90 or -90) Use that for the next Yaw set rotation

rose citrus
#

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

rich granite
maiden wadi
#

@rose citrus You can use multiple pointers on the same function call.

rose citrus
#

Ah how did I not know that

final skiff
bright harbor
#

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

maiden wadi
#

@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

charred berry
#

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 ;))

brazen merlin
#

Image widget

unique yoke
#

Random question. What’s the overhead on using variables (both global/local) and functions in blueprints, just for the sake of cleaning up legibility?

odd ember
maiden wadi
#

Cool.

odd ember
unique yoke
#

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

faint pasture
faint pasture
odd ember
#

premature optimization is the root of all evil

somber panther
faint pasture
somber panther
#

wdym?

odd ember
somber panther
#

The problem is probably in blueprints I think.

#

Animations are fine, I think

odd ember
#

my guess would be your anim state transitions aren't setup correctly

somber panther
#

Alr

odd ember
#

because state transitions are handled through the animation state machine behind the animBP

#

which brings me full circle to what I said before

somber panther
maiden wadi
# unique yoke Random question. What’s the overhead on using variables (both global/local) and ...

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.

inland stone
#

@maiden wadi so i should use location instead of hit?

maiden wadi
#

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.

zealous fog
#

Casting to the player character shouldn't take any extra resources right? Since the player character is always loaded?

maiden wadi
#

It would not, usually, no.

zealous fog
#

Thanks

brazen merlin
maiden wadi
#

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.

inland stone
#

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

odd ember
indigo bough
#

Is there any reason why I can't create a subclass of AssetUserData?

maiden wadi
#

@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.

odd ember
#

data assets are cpp only afaik

#

as in, only workable in cpp. but they can be exposed to BP

rose citrus
#

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

maiden wadi
#

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.

rose citrus
#

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 -__-

odd ember
maiden wadi
#

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.

glad compass
#

how can I round a Rotator's values? I want something like 54, 160, 20 to turn into 90, 180, 0

odd ember
#

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

bright harbor
#

like input timer starts input again timer restarts

pine idol
#

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.

maiden wadi
#

@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.

azure bolt
#

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

zealous fog
#

Print string on your bool to verify if its true or false at that point

azure bolt
#

I said i already did that

#

It is indeed printing as true

zealous fog
#

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

azure bolt
#

it runs through the loop body, going through a false branch even when its true as well as a DoOnce node

pine idol
zealous fog
#

Hmmm I don't know I'd break the connections refresh nodes attach again an compile

#

Otherwise it's above my skill

#

Lol

#

Sorry

azure bolt
#

Alright I'll try that, thanks anyway πŸ™‚

odd ember
azure bolt
clear warren
#

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

odd ember
zealous fog
#

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

azure bolt
#

Thanks! I'll take a look

devout pivot
#

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

odd ember
#

there is probably a way. is there a way in BP? unlikely

pine idol
#

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.

odd ember
#

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

pine idol
odd ember
hazy igloo
rich granite
#

Hey all!

#

My Lookat is -135, my Theta is 90, so why are both addition and subtraction nodes returning -135 as an answer?

zealous fog
#

Theta must register as 0

#

Refresh nodes and compile again

#

Or its set as 0 somewhere

maiden wadi
#

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.

midnight ravine
#

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?

odd ember
midnight ravine
odd ember
#

not at all

midnight ravine
#

how do I get the "input action"?

odd ember
#

... you have it

midnight ravine
#

I have no way to pass it around afaik

odd ember
#

you need a function inside your game hud

#

that takes it as a parameter

midnight ravine
#

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.

odd ember
#

????

#

how can you possibly get to know that?

midnight ravine
#

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.

odd ember
#

you can

midnight ravine
#

@odd ember

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

midnight ravine
#

then I'm misunderstanding what you're saying completely.

odd ember
#

but you can't get to know a button before a user presses it

#

yes

#

you are

midnight ravine
#

so I can't

midnight ravine
#

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...

odd ember
#

you can't pass the parameter at the time of spawning it

#

like it doesnt make sense

odd ember
#

you can call a function any time

#

you can't call beginplay any time

worthy rock
#

I have a cpp timer event. And a child blueprint which sees the event.

How can I receive the event with any actor blueprint?

odd ember
#

unless the child blueprint is globally accessible you cant

worthy rock
#

Can I make the childblueprint globally accessible?

midnight ravine
#

@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

odd ember
midnight ravine
#

mate. I found the node I was looking for

#

it's as simple as that lmao

odd ember
#

try it

#

see if it makes any difference

midnight ravine
#

yeah trying it rn

worthy rock
odd ember
#

I think you're missing the fundamentals of what a generic function is or how it is used compared to something like beginplay

midnight ravine
#

@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.

odd ember
#

bindings are only relevant for callbacks

midnight ravine
#

sorry Binding is the wrong term. I meant this by that:

#

a Bind function I guess?

odd ember
#

it's the same thing. it's not what I was referring to.

mint mica
#

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

odd ember
#

up to you

mint mica
#

after the level loads, but the level is just one huge textureless plain

maiden wadi
#

@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.

mint mica
#

does ue still avoid rendering them based on distance?

#

the runtime created ones i mean

#

probably not googling for the right thing lol

odd ember
#

but I'm not sure what your issue is really

#

1k cubes in an empty map shouldn't be a massive undertaking

mint mica
#

i think i've found what i was looking for using the wrong term should have been looking for culling distance

odd ember
rich granite
# zealous fog Theta must register as 0

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.

odd ember
rich granite
rich granite
odd ember
#

is it specific to the level?

main lake
#

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 ?

odd ember
rich granite
# odd ember is it specific to the level?

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.

main lake
odd ember
odd ember
rich granite
cosmic sonnet
#

is there a way to check if the code is running in the editor? there's nothing called like IsEditor

odd ember
#

I believe there's something called IsPIE

#

or if not, it exists in cpp and you can expose it

odd ember
rich granite
#

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?

odd ember
#

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

rich granite
#

Most definitely, but I'm not sure how I would place them.

odd ember
#

as in, spawning them?

rich granite
#

Yus

odd ember
#

I imagine this would be some player controller action or so. but I don't know the details of your implementation

rich granite
#

Ah, see.

#

It's a 0 player game.

odd ember
#

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

rich granite
#

So, the question is, how do the individual cannons know what their spawn coordinates should be?

odd ember
#

and each class is still responsible for their own individual actions

#

the manager just handles the "group" actions

odd ember
rich granite
odd ember
#

well you use spawn coordinates on the spawn node

#

for obvious reasons the actor can't spawn itself

vestal acorn
#

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

vestal acorn
odd ember
#

what's inside those macros?

vestal acorn
rich granite
odd ember
#

I don't even see the turrets being placed

odd ember
vestal acorn
#

its the same, im just not using the z value of it

rich granite
# odd ember I don't see anything egregious here.

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.

odd ember
rich granite
odd ember
#

but yeah, your approach of look at rotation I've used as well for the same

#

(and it's worked)

vestal acorn
#

ehh

#

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

odd ember
#

the capsule collision of the player character?

vestal acorn
#

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

odd ember
#

so you want to know if the sphere is inside a radius of the player character, yes?

#

or am I misreading it?

vestal acorn
#

yes

thorn trellis
#

Does anyone know how to actually setup ControlRotation when you're locking the camera to HMD (vr headset)?

vestal acorn
#

oh im dumb I should just compare the new hit location and the mesh in the context of distance...

odd ember
#

I had to actually find the code I did

manic osprey
#

How can I make 2 movable actors move like one ? I have them parent child but they do not move as one.

vestal acorn
mossy mist
#

how do i create an image

#

in construct

#

using a node

#

one of these things

#

also how to create spacers

odd ember
#

not sure if that's possible in BP. but you can try construct widget

slate hound
#

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

strong shell
# mossy mist

pretty sure it's SetBrush on the image widget, split the Brush struct, and then add your texture/material

strong shell
#

between inair and land

slate hound
#

Transition Rules? They are fine and working it's just not displaying the debug info correctly

strong shell
#

also looks like you got two going from land to grounded

#

oh

#

debugging those I haven't learned yet xD

slate hound
#

it's supposed to show the percentage updating as it transitions but they are just stuck on 100% / 1% or whatever

flat coral
#

Are "being destroyed" and "pending kill" interchangeable for decals, or do they mean different things?

mossy mist
#

i need to create an image

#

not set a texture on one

strong shell
#

oh, uh, lemme check

mossy mist
#

alr tell me if u find one but imma just go and make an array tower as a hacky replacement

strong shell
#

isn't there a "get childeren of widget" method?

#

still waiting for my code to compile so unreal starts xD

strong shell
mossy mist
#

yea that would work

#

alr tty

icy dragon
devout kelp
#

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?

ornate linden
#

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?

gentle urchin
#

Depends on the input

ornate linden
#

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

last abyss
#

as long as the struct ref is a pointer to the struct you're trying to change it should work

ornate linden
#

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?

last abyss
#

for each loop gives a copy

ornate linden
#

is there a way to do a loop where it does give a reference

last abyss
#

you can make your own for each loop.. or just get the array index and use that to get ref

ornate linden
#

interesting, both seem valid. Thanks

#

that worked. also learned how to pass values by reference into functions. fun stuff

ornate linden
#

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

final python
#

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)

ornate linden
#

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

final python
#

thank you so much

#

I've spent like 45 minutes trying to figure that out

ornate linden
#

haha, happens

final python
#

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

ornate linden
#

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

final python
#

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

dapper crescent
#

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?

final python
#
*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

fossil skiff
#

how do i add tag using blueprint

gentle urchin
#

Get the tags array, add to it

worthy rock
#

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.

tight schooner
#

@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?

worthy rock
#

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.

gentle urchin
#

Is the exec connected when testing ? πŸ˜…

worthy rock
#

exec?

gentle urchin
#

The execution pins

#

The "Update" pin

#

White one

hearty lintel
#

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?

worthy rock
#

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.

gentle urchin
#

If it output 0 it wouldnt move, would it

#

Instantly you mean?

worthy rock
#

If the object wasn't set to zero in it would.

#

Yea

gentle urchin
#

Show me hownits connected properly lol

worthy rock
gentle urchin
#

Show me the bp graph

worthy rock
gentle urchin
#

Whats its default relative location?