UI duplicating on each scene load?

Every time the scene switches in my game, another UI spawns on top of the existing one, how do I fix this? Im pretty sure these are the only two scripts that could be affecting it but im making this from a template so im not sure.

You are doing dontdestroy, so its staying but next time round it will make it again because you arent checking you dont need another copy

ok then how do i fix that?

Well you could check if something of that name/type already exists and if it is, kill itself

yes but what code would i write in order to do it

Well theres a bunch of ways, but have you looked up for example singletons?

ill look now thanks!