Code not working

Hi

For some strange reason, my code is not working and it’s not showing that I’ve done anything wrong either. I’ll attach a few screenshots of my code, a screenshot of the grabber being attached to the bp_player, and the log when I’m compiling.

I’ve been having problems with coding all day, first because of live coding which I’ve turned off since then and now this. Is it really supposed to be such a repetitive process just to save a code and for it to not just disappear from the editor?



And you get no output when you press play?

I mean the mover component is working fine but no output at all in regards to “grabber” or “rotation”.
This is the output log from when I press play:

LogDebuggerCommands: Repeating last play command: Selected Viewport
LogPlayLevel: PlayLevel: No blueprints needed recompiling
PIE: New page: PIE session: Dungeon (8 Jun 2023, 12:55:38)
LogOnline: OSS: Created online subsystem instance for: NULL
LogOnline: OSS: TryLoadSubsystemAndSetDefault: Loaded subsystem for module [NULL]
LogPlayLevel: Creating play world package: /Game/UEDPIE_0_Dungeon
LogPlayLevel: PIE: StaticDuplicateObject took: (0.018760s)
LogPlayLevel: PIE: Created PIE world by copying editor world from /Game/Dungeon.Dungeon to /Game/UEDPIE_0_Dungeon.Dungeon (0.018852s)
LogSubsystemCollection: Failed to initialize subsystem dependency (WorldPartitionSubsystem)
LogChaos: FPhysicsSolverBase::AsyncDt:-1.000000
LogAIModule: Creating AISystem for world Dungeon
LogPlayLevel: PIE: World Init took: (0.000644s)
LogUObjectHash: Compacting FUObjectHashTables data took   0.31ms
LogAudio: Display: Creating Audio Device:                 Id: 2, Scope: Unique, Realtime: True
LogAudioMixer: Display: Audio Mixer Platform Settings:
LogAudioMixer: Display:     Sample Rate:                          48000
LogAudioMixer: Display:     Callback Buffer Frame Size Requested: 1024
LogAudioMixer: Display:     Callback Buffer Frame Size To Use:    1024
LogAudioMixer: Display:     Number of buffers to queue:           2
LogAudioMixer: Display:     Max Channels (voices):                0
LogAudioMixer: Display:     Number of Async Source Workers:       0
LogAudio: Display: AudioDevice MaxSources: 32
LogAudio: Display: Audio Spatialization Plugin: None (built-in).
LogAudio: Display: Audio Reverb Plugin: None (built-in).
LogAudio: Display: Audio Occlusion Plugin: None (built-in).
LogAudioMixer: Display: Initializing audio mixer using platform API: 'XAudio2'
LogAudioMixer: Display: Using Audio Hardware Device Speakers (Realtek(R) Audio)
LogAudioMixer: Display: Initializing Sound Submixes...
LogAudioMixer: Display: Creating Master Submix 'MasterSubmixDefault'
LogAudioMixer: Display: Creating Master Submix 'MasterReverbSubmixDefault'
LogAudioMixer: FMixerPlatformXAudio2::StartAudioStream() called. InstanceID=2
LogAudioMixer: Display: Output buffers initialized: Frames=1024, Channels=2, Samples=2048, InstanceID=2
LogAudioMixer: Display: Starting AudioMixerPlatformInterface::RunInternal(), InstanceID=2
LogAudioMixer: Display: FMixerPlatformXAudio2::SubmitBuffer() called for the first time. InstanceID=2
LogInit: FAudioDevice initialized.
LogAudio: Display: Audio Device (ID: 2) registered with world 'Dungeon'.
LogLoad: Game class is 'GameModeBase'
LogWorld: Bringing World /Game/UEDPIE_0_Dungeon.Dungeon up for play (max tick rate 0) at 2023.06.08-10.55.38
LogWorld: Bringing up level for play took: 0.011374
LogOnline: OSS: Created online subsystem instance for: :Context_1
PIE: Server logged in
PIE: Play in editor total start time 0,103 seconds.

If you add a log in BeginPlay do you get that?

No, I dont’.

I tried to put a log message in “mover” and it shows up just fine but nothing when it’s put in “grabber”

And you’re sure you’re compiling successfully? What if you remove and re-add the component in the blueprint?

As far as I’m aware, yes. I’ve turned off live coding because it’s buggy in 5.03 (not using 5.2 because the course isn’t for that?)

So I’m compiling manually with the button on the lower downside of the unreal editor screen.

I’ve also tried to delete the component and re-add it to the blueprint without any success. It’s really weird because any code I write in the other c++ scripts works but specifically not this one.

Would you mind sending me your project using the following link?

https://gdev.tv/projectupload

Please use File > Zip Project within Unreal as this will ensure only required files are zipped up and things like the Binaries are excluded.

Sent it

Thank you

You have a game mode override, remove it

image

Windows > World Settings if you don’t have it open.

Wow, that’s weird but yea that did the trick! Thanks a lot

For future references, what does “GameMode Override” do?

override the game mode for that level. So you were using GameModeBase for the game mode which uses DefaultPawn for the default pawn class whereas the game mode you have selected in your project settings is using BP_Player, which has the Grabber component on it, the DefaultPawn does not.

Gotcha!

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

Privacy & Terms