Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to change model opacity with animation?

$
0
0

I want to change the opacity of a 3D object with animation. Since RealityKit is highly integrated with SwiftUI on visionOS, I tried this method:

let model = ModelEntity()withAnimation(.easeInOut) {    model.components[OpacityComponent.self] = .init(opacity: 0.25)}

However, it didn't work.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>