if place_meeting(x,y,obj_tparent) = true //If obj_rightclick_button is over obj_tower parent if global.player_money > (50*other.tower_ratio) //If the player's money is X amount based on a variable on the applicable tower
Basically it checks for the parent of obj_tower which is named obj_tparent. This allows me to set all towers to have the parent of obj_tparent and have any collision checks apply to each one. What I need though, is a specific way to use a variable from the specific tower in which collision is occurring. To do that, I have attempted the use of other.tower_ratio, but it doesnt work and keeps telling me that it is an unknown variable. From what I can tell, the other. variable can only refer to another event within the same object, in this case obj_rightclick_button, but cannot refer to another object entirely.
Assuming that makes sense, does anybody know a way to pull a variable out of another object that collision has occured with? I would have used global.tower_ratio, but I am fairly certain that if I were to use that then I could not have individual ratios (Basically, prices) for different towers in my game.
Let me know if you need clarification of anything - thanks in advance.