Can someone help, I put everything but my door still not open?

Here is the code, in the editor I fix everything, physics, overlap but my door can’t open. I think is a problem with TotalMass and I can’t put the Mass from actors in that variable



PressurePlate is null as you never assign it a value compare your two FindXX functions.

I used a variable name Pressure instead of PressurePlate. It’s null at declaration,
and here I using a pressure with pointer
Pressure->GetOverlappingActors(OUT OverlappingActors);

What do I need to do?

Right, you just described the problem. You set it to nullptr and then that’s it.

Did you look at the two functions I told you to? It should become apparent as to what the cause and solution is.

I have 2 functions void UDoorRotation::FindAudioComponent()
and void UDoorRotation::FindpressurePlate(). But What to do whit them? It’s just if loop with condition (!Pressure). Pressure is a pointer from triggervolume and I put a value with

Pressure->GetOverlappingActors(OUT OverlappingActors);

Problem is that pressure after this line of code it’s again nullptr, how I can also put a value here
I don’t understand what I else need to do

@DanM And the code it’s like on your course I really don’t know what else I can do?

I’m so sorry, I completely misremembered how this was set up.
That variable should be assigned in the editor. Did you not do that?

Of course, I did, but I have a problem here it’s nothing in the pressure variable. And I don’t know what else I can do

Do you need something else to send to you?

I don’t know what you mean by this but the problem is almost definitely because that variable is nullptr.

Dereferencing a nullptr would crash your program which is what you are doing by

Pressure->

That dereferences the pointer.


Do you have multiple open door components? If you do did you set it on all of them?

I think it’s a nullptr; in pressure.

No pressure set with this code and that’s the problem. No, it’s just one door

Could you show where you you have in the editor?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms