JadeKnightblazer Posted February 24, 2015 Share Posted February 24, 2015 Trying to make an outer object with an inner hotspot object. The hotspot is the part the player can interact with, while the outer is just for Collision. The problem I am having is... If I make the outer object the parent of the inner object, the player can no longer interact with it. If I make the inner object the parent of the outer object, then the outer object looses its Collision. help T_T Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/ Share on other sites More sharing options...
JadeKnightblazer Posted February 25, 2015 Author Share Posted February 25, 2015 (edited) Or would it be just better to use Tiled and set up a Custom setpiece, since I want it to world gen spawn anyways like the Pig King. Edited February 25, 2015 by JadeKnightblazer Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616390 Share on other sites More sharing options...
rezecib Posted February 25, 2015 Share Posted February 25, 2015 @JadeKnightblazer, I'm not sure I understand what you're trying to do. Why do you need the parent/child relationship? Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616411 Share on other sites More sharing options...
JadeKnightblazer Posted February 25, 2015 Author Share Posted February 25, 2015 (edited) Kk, the long story I am making a custom Pond, that is fishable. This pond is... inst.Transform:SetScale(2, 2, 2) --Using the same anim as the normal pond atm, just making it biggerMakeObstaclePhysics(inst, 15.6) --Makes it so its hit box is large and stops player from walking in the water. Now this works, however Fishing is quite odd... It seems the player can fish at this pond from a long distance, to the point of about 3 beefalo away from the ponds hitbox itself!!! So collision good, fishing bad. To fix this issue I was thinking about making another Pond, aka Hotspot. This pool will be inside the larger collision Pond. The collision pond will no longer be fishable. Hotspot will not be using the inst.Transform:SetScale(2, 2, 2), but insteed...MakeObstaclePhysics(inst, 5) --To make its hit box big enough to fix at from the border of the collision Pond. I need a way to place the Hotspot inside the Collision pond w/o the collision pond overlapping it or blocking the players mouse from interacting. Figured using the parent / child thing would be the best route... but as stated above in the thread, is collision pond is a child of hotspot, collision pond no longer has its collision. Edited February 25, 2015 by JadeKnightblazer Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616412 Share on other sites More sharing options...
JadeKnightblazer Posted February 25, 2015 Author Share Posted February 25, 2015 So now I am trying to use Tiled to over lap the two entities Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616420 Share on other sites More sharing options...
rezecib Posted February 25, 2015 Share Posted February 25, 2015 @JadeKnightblazer, You definitely don't have to do it with tiled. You could just have it spawn the collision object in the constructor for the other, and center it on its position. Since you're doing that, you probably also want to make the collision object not persist (inst.persists = false), because otherwise each time you reload it'll make a new one. Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616435 Share on other sites More sharing options...
JadeKnightblazer Posted February 25, 2015 Author Share Posted February 25, 2015 (edited) -delete- Edited February 25, 2015 by JadeKnightblazer Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616438 Share on other sites More sharing options...
JadeKnightblazer Posted February 25, 2015 Author Share Posted February 25, 2015 (edited) Being going back and forth trying to make them spawn one way, then the other. The collison pond hitbox just keep overwriting the hotspots =/= fishable after that. Also messing around with different physics to see which one ones the best. Edited February 25, 2015 by JadeKnightblazer Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616440 Share on other sites More sharing options...
JadeKnightblazer Posted February 25, 2015 Author Share Posted February 25, 2015 Finally figured it out, for some reason SpawnHotspot(inst) made it go crazy, I just added an inst:DoTaskInTime(1, SpawnHotspot), which works. Thanks tho Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616461 Share on other sites More sharing options...
rezecib Posted February 25, 2015 Share Posted February 25, 2015 @JadeKnightblazer, I'm guessing it didn't have a position until after the constructor finished, so spawning it within the constructor wouldn't work. I'd expect using inst:DoTaskInTime(0, SpawnHotspot) to work, as well (this pushes it onto the next sim tick). Link to comment https://forums.kleientertainment.com/forums/topic/51410-possible-to-give-a-child-its-own-physics/#findComment-616515 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now