Hey all, I’m trying to figure this out. I have one script that handles several objects, but needs to have different outcomes depending on which object it is attached to. It checks the object’s game property to differentiate between objects. Would something like this be correct? Is this how you access the game property of an object?
if obj["BlueKart"]: #if object has "BlueKart" property #do something that applies to blue kart elif obj["GreenKart"]: #if object has "GreenKart" property #do something that applies to green kart
I’m using this for the AI karts in my racing game. Instead of having a separate vehicle wrapper script for each kart, I want to have one script which changes the vehicle wrapper settings depending on the kart it’s attached to.