 6c5403cf47
			
		
	
	
		6c5403cf47
		
	
	
	
	
		
			
			# Objective A common pitfall since 0.8 is the requirement on `ComputedVisibility` being present on all ancestors of an entity that itself has `ComputedVisibility`, without which, the entity becomes invisible. I myself hit the issue and got very confused, and saw a few people hit it as well, so it makes sense to provide a hint of what to do when such a situation is encountered. - Fixes #5849 - Closes #5616 - Closes #2277 - Closes #5081 ## Solution We now check that all entities with both a `Parent` and a `ComputedVisibility` component have parents that themselves have a `ComputedVisibility` component. Note that the warning is only printed once. We also add a similar warning to `GlobalTransform`. This only emits a warning. Because sometimes it could be an intended behavior. Alternatives: - Do nothing and keep repeating to newcomers how to avoid recurring pitfalls - Make the transform and visibility propagation tolerant to missing components (#5616) - Probably archetype invariants, though the current draft would not allow detecting that kind of errors --- ## Changelog - Add a warning when encountering dubious component hierarchy structure Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
		
			
				
	
	
		
			12 lines
		
	
	
		
			223 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			223 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #[doc = include_str!("../B0001.md")]
 | |
| pub struct B0001;
 | |
| 
 | |
| #[doc = include_str!("../B0002.md")]
 | |
| pub struct B0002;
 | |
| 
 | |
| #[doc = include_str!("../B0003.md")]
 | |
| pub struct B0003;
 | |
| 
 | |
| #[doc = include_str!("../B0004.md")]
 | |
| pub struct B0004;
 |