how to properly give collision to multiple changing meshes while keeping them attatched

Godot Version

Godot 4.6 stable

Question

I’ve been trying to figure this out for a while, and I feel like I’m missing a really obvious and easy way to do this.

basicaly, I have this book, that opens by rotating two nodes acording to the animation instructions. my issue is that if I give each page its own collision then they fall apart from each other, and if i put the collision further up the family it cant properly represent the shape of the book as it changes through animations (ie when book is open, collision would still be the same as when it was closed).

extends Node3D
var State = 0
@onready var AnimationPlayerInst = $AnimationPlayer

func _input(event: InputEvent):
	if event.is_action_pressed("use"):
		if State == 0:
			open()
			State = 1
		else:
			close()
			State = 0
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta) -> void:
	pass
func _physics_process(_delta) -> void:
	pass

func open():
	AnimationPlayerInst.play("Open")

func close():
	AnimationPlayerInst.play("Close")

Not totally following on what you’re trying to do, but have you looked at collision layers and masks?

I have, but its possible I’m not properly understanding how they work.

basicly I have an object that folds open and closed using an animation, and in the current build the two pages are able to fall apart because they are seperate objects. I want them to stay attatched at the crease.

but if I make them the same, then the collision does not update to match their new shape when they open and close

(sorry again if it’s not clear, I don’t really know how to claify any further)

So the collision layer is like the out bound, and masks are the inbound.

So if you have Object A on layer 1, and object B masked on 1. If you move B if would collide with A, but if you move A it wouldn’t collide with B. (Hopefully that makes sense)

So you could just turn off both masks or set them to a different layers and they shouldn’t collide with each other.

i uhh, I did not understand this.

adding a hinge joint as the parent of my rigid bodies has fixed the issue however TwT