Jump to content

Poster/Picture Unity Tutorial Request


Recommended Posts

I would like to request a tutorial in unity on how to add your own custom posters and pictures. I have been trying to make some posters and pictures in Unity recently and thought i could figure out the process on my own. However, i came into an issue that has been driving me crazy. I get the posters in game and working except for one small annoyance there is a big space of air between the poster and the wall. I know it is because the poster is on the front of the cuber but I cant figure out how to get it to the back of the cube so it sticks on the wall. I have been comparing it to other poster and just can't figure out how to get rid of that space of air, it is not even a full cube space its like 1/4 maybe. No luck finding any tutorials in Utube or online. I am sure it is something ridiculously stupid I am over looking. No rush just when someone has time to do a tutorial please do.

 

Thanks

Astral

Link to comment
Share on other sites

One way is to create a new block object and set its transform at 000.  Then you make sure your view is set to be looking at that block from the front.  Align your poster so it's flush with the back face of cube.  

Link to comment
Share on other sites

Okay so I tried following Xyth's tip, thank you btw and got rid of the air spot but now have another really weird issue. In the prefab editor where I test the posters, I can pick up the poster using the E option that appears. However, in the actual game there is no E option:( so they just stick to the walls. I know in Unity I put the T_Mesh_B tag on them in tag 2 just like Xyth's tutorial stated and it is really weird that they can be picked up in editor and not in game. Any suggestions on an xml code line or something I may be missing?

 

Thanks,

Astral

Link to comment
Share on other sites

Ah okay so T_Mesh_B if I am understanding this right is tag 4?

 

 

So I changed the tags repackaged and imported and the same thing is still happening. The E option appears in Prefab Editor where all the posters can be picked up. But the posters still cant be picked up in game, Unless tag 4 is not the T_Mesh_B. The only other it can be is 3 if items is tag 0.

Link to comment
Share on other sites

So changed tags yet again and imported them to game same issue can be picked up and such in prefab editor but not in game. Tried tag 4 and tag 3 for the T_Mesh_B with no luck. I don't know if the issue is xml code or something in Unity but find it really annoying that it all works fine in prefab editor but not in game.  The xml code is pretty much copied of the pictures that come with the game with some minor adjustments like them being able to be picked up, descriptions, and when destroyed get turned into an item for the player to pick up. Been using the destroy pick up as a substitute for just being able to pick them up.

Link to comment
Share on other sites

@Telric That is how I had it Telric then Xyth said to add the TagManager.asset to my folder which in my case is E:/Unity/7D2Dtest/7D2D/ProjectSettings. I added the tag manager, reviewed it, and it looked like the tag may have changed in the manager it has T_Mesh_B in either slot 3 or slot 4 depending on if Items is slot 0 or 1. unless that doesn't matter anymore the tutorial said they had to be in a specific order, but Xyth said lots has changed. Anyway I changed them back to what you just stated Telric and it did not work. I will post a code up later I have to go to work in a few.

 

@Xyth is that the appropriate folder? I read very carefully where to put it and it seemed like the right spot.

 

Thanks for advice guys!

Link to comment
Share on other sites

.DeanTestChild.thumb.png.a9bd7fd58eac800d199b19e04682ea59.pngDeanTestParent.thumb.png.bc6e8d71dac29cbea2f72ca6c006e768.png

 

The first one is the child, the second one is the parent.

 

This is the XML code.  

    <block name="DeanTest">
            <property name="CreativeMode" value="Player"/>
            <property name="Material" value="Mglass"/>
            <property name="StabilitySupport" value="false"/>
            <property name="Shape" value="ModelEntity"/>
            <property name="Model" value="#@modfolder:Resources/DeanTest.unity3d?DeanTest"/>
            <property name="Place" value="TowardsPlacerInverted"/>
            <property name="CustomIcon" value="DeanWorkOut" />
            <property name="CanPickup" value="true" />
            <property name="IsDecoration" value="true"/>
            <property name="ImposterDontBlock" value="true"/>
            <drop event="Destroy" name="DeanWorkOut" count="1"/>
            <property name="FilterTags" value="fdecor,fother"/>
            <property name="SortOrder1" value="7000"/>
            <property name="SortOrder2" value="0002"/>
            <property name="DescriptionKey" value="DeanWorkOutDesc"/>
            <property name="EconomicBundleSize" value="1"/>
            <property name="SellableToTrader" value="true"/>
            <property name="EconomicValue" value="275"/>
        </block>

Link to comment
Share on other sites

Well, the first issue i see is the parent has to be set to 0,0,0.. if not, bad things can and will happen. Its very possible the block is being clipped in a normal game. In prefab editor, you have extended reach for hitscans and such, so its possibly just that the parent block is behind something else that's blocking the hitscan to work...  So try that out first.

Link to comment
Share on other sites

If that background is an object, the painting is probably going behind that object. The parent has to be at 0,0,0 And scale of 1,1,1. Then you move the child object to line up with w/e your reference is. Many many issues come from a parent not being at 0,0,0. If your parent is at 0,1,0 it tells the block that instead of being where the block should be, its actually 1 block higher (x, y, z). So that's very very important to get right. So make the parent 0,0,0 and scale to 1,1,1.. Then go to the child object and move that around till you're happy. You can hit F to zoom in to where that child object is, when it's selected. Could just be that it moved off screen or something.

Link to comment
Share on other sites

Your awesome Telric thanx for reading my post. Your method worked with my DeanTest, however, I got excited and changed it on all my dean posters, but than when I tried to load up the game got an error:

 

ERR Loading AssetBundle "E:/Steam/SteamApps/common/7 Days To Die/7daystodie_Data/../Mods\Astral/Resources/DeanWinchesterCollection.unity3d" failed!
2020-08-04T20:06:20 220.806 ERR Model '#@modfolder(Astral Mod):Resources/DeanWinchesterCollection.unity3d?DeanAbs' not found on block with name DeanAbs
2020-08-04T20:06:20 220.806 ERR XML loader: Loading and parsing 'blocks.xml' failed
2020-08-04T20:06:20 220.806 EXC Model '#@modfolder(Astral Mod):Resources/DeanWinchesterCollection.unity3d?DeanAbs' not found on block with name DeanAbs
Exception: Model '#@modfolder(Astral Mod):Resources/DeanWinchesterCollection.unity3d?DeanAbs' not found on block with name DeanAbs

 

I controlled clicked them all to include them in the collection if that matters. It is very weird because they all look exactly like the DeanTest only difference was I tried packing them all at once.

Link to comment
Share on other sites

Seems it didnt load the bundle.. Double check that it exported correct and double check spelling. And remember you're targetting the parent object for the name. So DeanAbs should be the parent object you're wanting. You def can pack multiple things into one unity3d file, so it's gotta be something between there and exporting or spell checking

Link to comment
Share on other sites

45 isnt too many, itll work.. I'm not sure why it wouldnt be working.. It might be a good idea to break them up into smaller bits to see if maybe one or two are causing the script to not work. Possible that poster #17 is bugging the script out, so the rest dont get exported or something. Look for any errors in the bottom part of your unity.. Im headin to bed, so... ill respond tomorrow if you come across something else.

Link to comment
Share on other sites

@Telric just wanted to let you know before I head to work everything is working fine. Changing those numbers was the only problem. The error I got was because I had one of the prefabs open in scene and unity didn't like that it packaged fine once scene was closed. Thanks again for all the help and input.

Link to comment
Share on other sites

2 hours ago, Astralweaver said:

@Telric just wanted to let you know before I head to work everything is working fine. Changing those numbers was the only problem. The error I got was because I had one of the prefabs open in scene and unity didn't like that it packaged fine once scene was closed. Thanks again for all the help and input.

No problem. Glad its all working. Usually it is one of those super simple errors that mess everything up. :)  Atleast next time you have this issue, you'll remember to check the transforms as step 1 lol.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...