World space to object space

I’m trying to create an ice shader with icicles hanging below, which is now working. The problem is the objects that have the ice need to be animated so that the icicles will rotate with the animation movement and rotations. The shader that I have created always pulls the icicles down towards the negative Z axis and I need to make sure if an object with ice rotates the icicles will follow the rotation values of object they’re assigned to. Can anyone tell me if there is any way to clamp my displacement so the resulting value will follow an objects rotation?