Guest Messenjah Posted April 30, 2013 Share Posted April 30, 2013 So, recently I noticed a throwing knife mod and I was thinking, and I am wondering about the possibility of creating a throwing knife mini-game? The part that I am wondering about however, is how to set up a target and detect the hit? I was thinking about maybe setting up trigger boxes that detect if the knife is within the trigger box, however I'm not sure if this would work? Anyone ever try something like this? Link to comment Share on other sites More sharing options...
GrimyBunyip Posted April 30, 2013 Share Posted April 30, 2013 You will need to create several objects, one for each triggerbox.Then put a script on each object, with an onhit event. annd, that's it. Link to comment Share on other sites More sharing options...
Guest Messenjah Posted April 30, 2013 Share Posted April 30, 2013 Create several objects? So, seperate the target itself into several different objects and place an on-hit event on each object to detect the hit? Would I even need the triggerbox in this case? If I split the object up, I will need a good tutorial on porting custom objects from Blender and setting up collision meshes for them. :\ I was hoping that a triggerbox could just detect the knife inside as an objectreference, then tally points on each hit? Link to comment Share on other sites More sharing options...
GrimyBunyip Posted April 30, 2013 Share Posted April 30, 2013 Create several objects? So, seperate the target itself into several different objects and place an on-hit event on each object to detect the hit? Would I even need the triggerbox in this case? If I split the object up, I will need a good tutorial on porting custom objects from Blender and setting up collision meshes for them. :\ I was hoping that a triggerbox could just detect the knife inside as an objectreference, then tally points on each hit? If there's a function that can return your knife as an object reference then your suggested method would work, but I'm not sure there is.OnHit returns the projectile form and the object reference of the person who threw it, which isn't what you want. Link to comment Share on other sites More sharing options...
GrimyBunyip Posted April 30, 2013 Share Posted April 30, 2013 here is an idea put the on hit events on the throwing daggers. create an invisible explosion spell centered on the target. when the explosion hits the daggers, it triggers the onhit.which calculates the position of the daggers, which then calculates the score. the problem with this is getting the scoring system to align with what the target looks like will be a pain and will need to be redone for each target. Link to comment Share on other sites More sharing options...
Guest Messenjah Posted April 30, 2013 Share Posted April 30, 2013 We can probably make the target objects if I need to... for example, a bullseye inside a ring, inside a ring, inside another ring..... Then do an on-hit that detects if it was attacked by the PlayerRef and if it was hit by a throwing knife as a weapon. Then have an integer called points, that adds + 15 or whatever to a quest script that controls the mini-game. Isn't this essentially what you said would work in the first statement? Rather than going through all the complexities of messing with an invisible spell or other such things, I would rather create a hitbox. From what I understand, you can use object references with an ontriggerenter event. The question I have is, can I add the knife as an object reference to this? Then, rather than an on-hit event, the triggerbox just sees the knife as entering the trigger. So far I've used npc's and the player as object references for OnTriggerEnter events, but never a knife/projectile. Link to comment Share on other sites More sharing options...
Recommended Posts